1 // RUN: %clang_cc1 -pedantic -std=c++1y -include %s -include %s -verify %s
2 // RUN: %clang_cc1 -pedantic -std=c++1y -emit-pch -o %t.1 %s
3 // RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t.1 -emit-pch -o %t.2 %s
4 // RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t.2 -verify %s
6 // RUN: %clang_cc1 -pedantic -std=c++1y -emit-pch -fpch-instantiate-templates -o %t.1 %s
7 // RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t.1 -emit-pch -fpch-instantiate-templates -o %t.2 %s
8 // RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t.2 -verify %s
18 template<typename T
> constexpr A
make() { return A
{}; }
19 template<typename T
> constexpr A
make(T t
) { return A
{ t
}; }
23 constexpr B(int k
) : z1(k
) {}
26 template<typename T
> struct C
{
31 // Instantiate C<int> but not the default initializer.
34 #elif !defined(HEADER_2)
37 // Instantiate the default initializer now, should create an update record.
42 static_assert(A
{}.z
== 3, "");
43 static_assert(A
{1}.z
== 4, "");
44 static_assert(A
{.y
= 5}.z
== 5, ""); // expected-warning {{C++20}}
45 static_assert(A
{3, .y
= 1}.z
== 4, ""); // expected-warning {{C99}} expected-note {{here}}
46 static_assert(make
<int>().z
== 3, "");
47 static_assert(make
<int>(12).z
== 15, "");
48 static_assert(C
<int>().c
== 0, "");