* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / initlist56.C
blob5339dbfa403593652dd2aae8aaa9627f84ee5d17
1 // PR c++/47453
2 // { dg-do compile { target c++11 } }
4 // invalid
5 int a({0});                     // { dg-error "" }
7 // invalid
8 int const &b({0});              // { dg-error "" }
10 // invalid
11 struct A1 { int a[2]; A1(); };
12 A1::A1():a({1, 2}) { }          // { dg-error "" }
14 struct A { explicit A(int, int); A(int, long); };
16 // invalid
17 A c({1, 2});                    // { dg-error "" }
19 // valid (by copy constructor).
20 A d({1, 2L});
22 // valid
23 A e{1, 2};
25 #include <initializer_list>
27 struct B {
28   template<typename ...T>
29   B(std::initializer_list<int>, T ...);
32 // invalid (the first phase only considers init-list ctors)
33 // (for the second phase, no constructor is viable)
34 B f{1, 2, 3};                   // { dg-error "" }
36 // valid (T deduced to <>).
37 B g({1, 2, 3});