OSDN Git Service

2012-12-15 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / initlist37.C
1 // DR 990
2 // { dg-options "-std=c++0x" }
3
4 #include <initializer_list>
5
6 struct S {
7   S(std::initializer_list<double>);  // #1
8   S(std::initializer_list<int>);     // #2
9   S();                                     // #3
10   // ...
11 };
12 S s1 = { 1.0, 2.0, 3.0 };            // invoke #1
13 S s2 = { 1, 2, 3 };                  // invoke #2
14 S s3 = { };                          // invoke #3 (for value-initialization)
15
16
17 // Test some other situations, too.
18 void f (S);
19 int main()
20 {
21   S s4 { };
22   f({ });
23   S {};
24 }