diff options
Diffstat (limited to 'test/ASTMerge')
-rw-r--r-- | test/ASTMerge/Inputs/class-template1.cpp | 13 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/class-template2.cpp | 15 | ||||
-rw-r--r-- | test/ASTMerge/class-template.cpp | 9 |
3 files changed, 37 insertions, 0 deletions
diff --git a/test/ASTMerge/Inputs/class-template1.cpp b/test/ASTMerge/Inputs/class-template1.cpp index 0f40309160..440b5abfc8 100644 --- a/test/ASTMerge/Inputs/class-template1.cpp +++ b/test/ASTMerge/Inputs/class-template1.cpp @@ -19,3 +19,16 @@ struct X5; template<typename> struct X6; +extern X0<int> *x0i; +extern X0<long> *x0l; +extern X0<float> *x0r; + +template<> +struct X0<char> { + int member; +}; + +template<> +struct X0<wchar_t> { + int member; +}; diff --git a/test/ASTMerge/Inputs/class-template2.cpp b/test/ASTMerge/Inputs/class-template2.cpp index 5eecf9e6c1..6300301a4f 100644 --- a/test/ASTMerge/Inputs/class-template2.cpp +++ b/test/ASTMerge/Inputs/class-template2.cpp @@ -18,3 +18,18 @@ struct X5; template<template<int I> class> struct X6; + +typedef int Integer; +extern X0<Integer> *x0i; +extern X0<float> *x0f; +extern X0<double> *x0r; + +template<> +struct X0<char> { + int member; +}; + +template<> +struct X0<wchar_t> { + float member; +}; diff --git a/test/ASTMerge/class-template.cpp b/test/ASTMerge/class-template.cpp index 847c9569e5..eea31b1c2f 100644 --- a/test/ASTMerge/class-template.cpp +++ b/test/ASTMerge/class-template.cpp @@ -13,3 +13,12 @@ // CHECK: class-template1.cpp:19:10: error: template parameter has different kinds in different translation units // CHECK: class-template2.cpp:19:10: note: template parameter declared here + +// CHECK: class-template2.cpp:25:20: error: external variable 'x0r' declared with incompatible types in different translation units ('X0<double> *' vs. 'X0<float> *') +// CHECK: class-template1.cpp:24:19: note: declared here with type 'X0<float> *' + +// CHECK: class-template1.cpp:32:8: warning: type 'X0<wchar_t>' has incompatible definitions in different translation units +// CHECK: class-template1.cpp:33:7: note: field 'member' has type 'int' here +// CHECK: class-template2.cpp:34:9: note: field 'member' has type 'float' here + +// CHECK: 1 warning and 5 errors generated. |