Reid Kleckner | 0333dd9 | 2019-05-14 18:51:07 +0000 | [diff] [blame^] | 1 | // FIXME: Errors are now warnings. |
| 2 | // XFAIL: * |
| 3 | // RUN: %clang_cc1 -std=c++1z -emit-pch -o %t.1.ast %S/Inputs/class-template1.cpp |
| 4 | // RUN: %clang_cc1 -std=c++1z -emit-pch -o %t.2.ast %S/Inputs/class-template2.cpp |
| 5 | // RUN: not %clang_cc1 -std=c++1z -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s |
| 6 | |
| 7 | static_assert(sizeof(X0<char>().getValue(1)) == sizeof(char)); |
| 8 | static_assert(sizeof(X0<int>().getValue(1)) == sizeof(int)); |
| 9 | |
| 10 | // CHECK: class-template1.cpp:9:14: error: non-type template parameter declared with incompatible types in different translation units ('int' vs. 'long') |
| 11 | // CHECK: class-template2.cpp:9:15: note: declared here with type 'long' |
| 12 | |
| 13 | // CHECK: class-template1.cpp:12:14: error: template parameter has different kinds in different translation units |
| 14 | // CHECK: class-template2.cpp:12:10: note: template parameter declared here |
| 15 | |
| 16 | // CHECK: class-template1.cpp:18:23: error: non-type template parameter declared with incompatible types in different translation units ('long' vs. 'int') |
| 17 | // CHECK: class-template2.cpp:18:23: note: declared here with type 'int' |
| 18 | |
| 19 | // CHECK: class-template1.cpp:21:10: error: template parameter has different kinds in different translation units |
| 20 | // CHECK: class-template2.cpp:21:10: note: template parameter declared here |
| 21 | |
| 22 | // CHECK: class-template2.cpp:27:20: error: external variable 'x0r' declared with incompatible types in different translation units ('X0<double> *' vs. 'X0<float> *') |
| 23 | // CHECK: class-template1.cpp:26:19: note: declared here with type 'X0<float> *' |
| 24 | |
| 25 | // CHECK: class-template1.cpp:35:8: warning: type 'X0<wchar_t>' has incompatible definitions in different translation units |
| 26 | // CHECK: class-template1.cpp:36:7: note: field 'member' has type 'int' here |
| 27 | // CHECK: class-template2.cpp:36:9: note: field 'member' has type 'float' here |
| 28 | |
| 29 | // CHECK: 1 warning and 5 errors generated. |
| 30 | // CHECK-NOT: static_assert |