1// RUN: %clang_cc1 -pedantic -std=c++1y -emit-pch %s -o %t
2// RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t -verify %s
3
4#ifndef HEADER_INCLUDED
5
6#define HEADER_INCLUDED
7
8struct A {
9  int x;
10  int y = 3;
11  int z = x + y;
12};
13template<typename T> constexpr A make() { return A {}; }
14template<typename T> constexpr A make(T t) { return A { t }; }
15
16struct B {
17  int z1, z2 = z1;
18  constexpr B(int k) : z1(k) {}
19};
20
21#else
22
23static_assert(A{}.z == 3, "");
24static_assert(A{1}.z == 4, "");
25static_assert(A{.y = 5}.z == 5, ""); // expected-warning {{C99}}
26static_assert(A{3, .y = 1}.z == 4, ""); // expected-warning {{C99}}
27static_assert(make<int>().z == 3, "");
28static_assert(make<int>(12).z == 15, "");
29
30#endif
31