blob: 6ab5ed5a7d5fb28b34cf95fbb23246e4820aedad [file] [log] [blame]
Reid Kleckner0333dd92019-05-14 18:51:07 +00001// RUN: %clang_cc1 -emit-pch -std=c++1z -o %t.1.ast %S/Inputs/class-template-partial-spec1.cpp
2// RUN: %clang_cc1 -emit-pch -std=c++1z -o %t.2.ast %S/Inputs/class-template-partial-spec2.cpp
Reid Kleckner2423b7d2019-05-14 19:02:39 +00003// RUN: %clang_cc1 -std=c++1z -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
Reid Kleckner0333dd92019-05-14 18:51:07 +00004
5static_assert(sizeof(**SingleSource.member) == sizeof(**SingleDest.member));
6static_assert(sizeof(SecondDoubleSource.member) == sizeof(SecondDoubleDest.member));
7static_assert(NumberSource.val == 42);
8static_assert(sizeof(Z0Source.member) == sizeof(char));
9static_assert(sizeof(Dst::Z0Dst.member) == sizeof(double));
10static_assert(sizeof(One::Child1<double, One::Two::Three::Parent<double>>::member) == sizeof(double));
11
Reid Kleckner2423b7d2019-05-14 19:02:39 +000012// CHECK: class-template-partial-spec2.cpp:21:32: warning: external variable 'X1' declared with incompatible types in different translation units ('TwoOptionTemplate<int, double>' vs. 'TwoOptionTemplate<int, float>')
Reid Kleckner0333dd92019-05-14 18:51:07 +000013// CHECK: class-template-partial-spec1.cpp:21:31: note: declared here with type 'TwoOptionTemplate<int, float>'
14
Reid Kleckner2423b7d2019-05-14 19:02:39 +000015// CHECK: class-template-partial-spec2.cpp:24:29: warning: external variable 'X4' declared with incompatible types in different translation units ('TwoOptionTemplate<int, int>' vs. 'TwoOptionTemplate<float, float>')
Reid Kleckner0333dd92019-05-14 18:51:07 +000016// CHECK: class-template-partial-spec1.cpp:24:33: note: declared here with type 'TwoOptionTemplate<float, float>'
17
18// CHECK: class-template-partial-spec1.cpp:38:8: warning: type 'IntTemplateSpec<5, void *>' has incompatible definitions in different translation units
19// CHECK: class-template-partial-spec1.cpp:39:7: note: field 'member' has type 'int' here
20// CHECK: class-template-partial-spec2.cpp:39:10: note: field 'member' has type 'double' here
21
Reid Kleckner2423b7d2019-05-14 19:02:39 +000022// CHECK: class-template-partial-spec2.cpp:52:25: warning: external variable 'Y3' declared with incompatible types in different translation units ('IntTemplateSpec<2, int>' vs. 'IntTemplateSpec<3, int>')
Reid Kleckner0333dd92019-05-14 18:51:07 +000023// CHECK: class-template-partial-spec1.cpp:52:25: note: declared here with type 'IntTemplateSpec<3, int>'
24
25// CHECK-NOT: static_assert