diff options
author | Richard Trieu <rtrieu@google.com> | 2017-05-31 00:31:58 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2017-05-31 00:31:58 +0000 |
commit | a7fae60ad9bddc322191668b3ddb0cb31e45b338 (patch) | |
tree | 472584d4251d670146e20809d059a0e6ec8e1274 /test/Modules | |
parent | 432867c65c539811e0e53cc1021250ce1f5d7853 (diff) |
[ODRHash] Support TemplateSpecializationType
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304261 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules')
-rw-r--r-- | test/Modules/odr_hash.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/Modules/odr_hash.cpp b/test/Modules/odr_hash.cpp index 947583bcfd..a6a0b74743 100644 --- a/test/Modules/odr_hash.cpp +++ b/test/Modules/odr_hash.cpp @@ -866,6 +866,40 @@ S9 s9; #endif } +namespace TemplateSpecializationType { +#if defined(FIRST) +template <class T1> struct U1 {}; +struct S1 { + U1<int> u; +}; +#elif defined(SECOND) +template <class T1, class T2> struct U1 {}; +struct S1 { + U1<int, int> u; +}; +#else +S1 s1; +// expected-error@first.h:* {{'TemplateSpecializationType::S1::u' from module 'FirstModule' is not present in definition of 'TemplateSpecializationType::S1' in module 'SecondModule'}} +// expected-note@second.h:* {{declaration of 'u' does not match}} +#endif + +#if defined(FIRST) +template <class T1> struct U2 {}; +struct S2 { + U2<int> u; +}; +#elif defined(SECOND) +template <class T1> struct V1 {}; +struct S2 { + V1<int> u; +}; +#else +S2 s2; +// expected-error@first.h:* {{'TemplateSpecializationType::S2::u' from module 'FirstModule' is not present in definition of 'TemplateSpecializationType::S2' in module 'SecondModule'}} +// expected-note@second.h:* {{declaration of 'u' does not match}} +#endif +} + // Interesting cases that should not cause errors. struct S should not error // while struct T should error at the access specifier mismatch at the end. namespace AllDecls { |