summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2017-06-15 01:35:06 +0000
committerRichard Trieu <rtrieu@google.com>2017-06-15 01:35:06 +0000
commitd9201d0a02c4b392c57490d13bb307a5025fcbfa (patch)
tree3d6ddb1971bc37ee207a0fc904110757f709bcb5 /clang/test/Modules
parent210a787f291f3f049da1959e059c9d7a633bdc40 (diff)
downloadbcm5719-llvm-d9201d0a02c4b392c57490d13bb307a5025fcbfa.tar.gz
bcm5719-llvm-d9201d0a02c4b392c57490d13bb307a5025fcbfa.zip
[ODRHash] Hash TemplateArgument::Pack and TemplateTypeParmType
llvm-svn: 305440
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/odr_hash.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/clang/test/Modules/odr_hash.cpp b/clang/test/Modules/odr_hash.cpp
index 51bd6269724..28b05a53564 100644
--- a/clang/test/Modules/odr_hash.cpp
+++ b/clang/test/Modules/odr_hash.cpp
@@ -1068,7 +1068,48 @@ 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
+}
+namespace TemplateTypeParmType {
+#if defined(FIRST)
+template <class T1, class T2>
+struct S1 {
+ T1 x;
+};
+#elif defined(SECOND)
+template <class T1, class T2>
+struct S1 {
+ T2 x;
+};
+#else
+using TemplateTypeParmType::S1;
+// expected-error@first.h:* {{'TemplateTypeParmType::S1::x' from module 'FirstModule' is not present in definition of 'S1<T1, T2>' in module 'SecondModule'}}
+// expected-note@second.h:* {{declaration of 'x' does not match}}
+#endif
+
+#if defined(FIRST)
+template <int ...Ts>
+struct U2 {};
+template <int T, int U>
+class S2 {
+ typedef U2<U, T> type;
+ type x;
+};
+#elif defined(SECOND)
+template <int ...Ts>
+struct U2 {};
+template <int T, int U>
+class S2 {
+ typedef U2<T, U> type;
+ type x;
+};
+#else
+using TemplateTypeParmType::S2;
+// expected-error@first.h:* {{'TemplateTypeParmType::S2::x' from module 'FirstModule' is not present in definition of 'S2<T, U>' in module 'SecondModule'}}
+// expected-note@second.h:* {{declaration of 'x' does not match}}
+// expected-error@first.h:* {{'TemplateTypeParmType::S2::type' from module 'FirstModule' is not present in definition of 'S2<T, U>' in module 'SecondModule'}}
+// expected-note@second.h:* {{declaration of 'type' does not match}}
+#endif
}
// Interesting cases that should not cause errors. struct S should not error
OpenPOWER on IntegriCloud