xref: /minix3/external/bsd/llvm/dist/clang/test/ASTMerge/class-template.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/class-template1.cpp
2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/class-template2.cpp
3*f4a2713aSLionel Sambuc // RUN: not %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
4*f4a2713aSLionel Sambuc 
5*f4a2713aSLionel Sambuc // CHECK: class-template1.cpp:7:14: error: non-type template parameter declared with incompatible types in different translation units ('int' vs. 'long')
6*f4a2713aSLionel Sambuc // CHECK: class-template2.cpp:7:15: note: declared here with type 'long'
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc // CHECK: class-template1.cpp:10:14: error: template parameter has different kinds in different translation units
9*f4a2713aSLionel Sambuc // CHECK: class-template2.cpp:10:10: note: template parameter declared here
10*f4a2713aSLionel Sambuc 
11*f4a2713aSLionel Sambuc // CHECK: class-template1.cpp:16:23: error: non-type template parameter declared with incompatible types in different translation units ('long' vs. 'int')
12*f4a2713aSLionel Sambuc // CHECK: class-template2.cpp:16:23: note: declared here with type 'int'
13*f4a2713aSLionel Sambuc 
14*f4a2713aSLionel Sambuc // CHECK: class-template1.cpp:19:10: error: template parameter has different kinds in different translation units
15*f4a2713aSLionel Sambuc // CHECK: class-template2.cpp:19:10: note: template parameter declared here
16*f4a2713aSLionel Sambuc 
17*f4a2713aSLionel Sambuc // CHECK: class-template2.cpp:25:20: error: external variable 'x0r' declared with incompatible types in different translation units ('X0<double> *' vs. 'X0<float> *')
18*f4a2713aSLionel Sambuc // CHECK: class-template1.cpp:24:19: note: declared here with type 'X0<float> *'
19*f4a2713aSLionel Sambuc 
20*f4a2713aSLionel Sambuc // CHECK: class-template1.cpp:32:8: warning: type 'X0<wchar_t>' has incompatible definitions in different translation units
21*f4a2713aSLionel Sambuc // CHECK: class-template1.cpp:33:7: note: field 'member' has type 'int' here
22*f4a2713aSLionel Sambuc // CHECK: class-template2.cpp:34:9: note: field 'member' has type 'float' here
23*f4a2713aSLionel Sambuc 
24*f4a2713aSLionel Sambuc // CHECK: 1 warning and 5 errors generated.
25