OSDN Git Service

Some raw string changes from N3077
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / initlist-deduce.C
1 // Test for deduction of T as std::initializer_list.  This isn't currently
2 // supported by the working draft, but is necessary for perfect forwarding
3 // of initializer-lists to things that can take a std::initializer_list.
4
5 // { dg-options -std=c++0x }
6 // { dg-do run }
7
8 #include <initializer_list>
9
10 struct A
11 {
12   A(std::initializer_list<int>) { }
13 };
14
15 void f (A a) { }
16
17 template <class T>
18 auto g (T&& t) -> decltype (f(t)) // { dg-warning "call" }
19 {
20   return f(t);
21 }
22
23 int main()
24 {
25   g({1});                       // { dg-warning "deduc" }
26 }