summaryrefslogtreecommitdiffstats
path: root/test/Modules
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2017-06-30 22:40:33 +0000
committerRichard Trieu <rtrieu@google.com>2017-06-30 22:40:33 +0000
commit5739844a09581298d1108c9aa91f2d74cd4962e5 (patch)
treebb6b540900294ea6af6334e1826e10be00a2dfda /test/Modules
parent7d6afdff43ab27efe4d841d6a235b732293b79cb (diff)
[ODRHash] Support Type TemplateArgument
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306904 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules')
-rw-r--r--test/Modules/odr_hash.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/Modules/odr_hash.cpp b/test/Modules/odr_hash.cpp
index f01c4e836a..3b21397169 100644
--- a/test/Modules/odr_hash.cpp
+++ b/test/Modules/odr_hash.cpp
@@ -1070,6 +1070,40 @@ S4 s4;
// expected-error@first.h:* {{'TemplateArgument::S4::x' from module 'FirstModule' is not present in definition of 'TemplateArgument::S4' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
#endif
+
+#if defined(FIRST)
+template <class T> struct U5 {};
+struct S5 {
+ U5<int> x;
+};
+#elif defined(SECOND)
+template <class T> struct U5 {};
+struct S5 {
+ U5<short> x;
+};
+#else
+S5 s5;
+// expected-error@first.h:* {{'TemplateArgument::S5::x' from module 'FirstModule' is not present in definition of 'TemplateArgument::S5' in module 'SecondModule'}}
+// expected-note@second.h:* {{declaration of 'x' does not match}}
+#endif
+
+#if defined(FIRST)
+template <class T> struct U6 {};
+struct S6 {
+ U6<int> x;
+ U6<short> y;
+};
+#elif defined(SECOND)
+template <class T> struct U6 {};
+struct S6 {
+ U6<short> y;
+ U6<int> x;
+};
+#else
+S6 s6;
+// expected-error@second.h:* {{'TemplateArgument::S6' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'y'}}
+// expected-note@first.h:* {{but in 'FirstModule' found field 'x'}}
+#endif
}
namespace TemplateTypeParmType {