PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / sfinae20.C
blob882efe768ec9cd515077f1fd81df029276159df1
1 // PR c++/48744
2 // { dg-do compile { target c++11 } }
4 template<class T>
5 struct add_rval_ref {
6   typedef T&& type;
7 };
9 template<>
10 struct add_rval_ref<void> {
11   typedef void type;
14 template<class T>
15 typename add_rval_ref<T>::type create();
17 template<class T, class Arg>
18 decltype(T{create<Arg>()}, char()) f(int);
20 template<class, class>
21 char (&f(...))[2];
23 static_assert(sizeof(f<int, void>(0)) != 1, "Error");