Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/initlist-deduce.C

raw
1 // { dg-do compile { target c++11 } }
2
3 #include <initializer_list>
4
5 struct A
6 {
7 A(std::initializer_list<int>) { }
8 };
9
10 void f (A a) { }
11
12 template <class T>
13 auto g (T&& t) -> decltype (f(t))
14 {
15 return f(t);
16 }
17
18 int main()
19 {
20 g({1}); // { dg-error "no matching function" }
21 }
22