Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / g++.dg / cpp0x / sfinae33.C
1 // PR c++/52422
2 // { dg-options -std=c++11 }
3
4 template<class T>
5 struct add_rval_ref
6 {
7   typedef T&& type;
8 };
9
10 template<>
11 struct add_rval_ref<void>
12 {
13   typedef void type;
14 };
15
16 template<class T>
17 typename add_rval_ref<T>::type create();
18
19 template<class T, 
20   class = decltype(create<T>()())
21 >
22 auto f(int) -> char(&)[1];
23
24 template<class>
25 auto f(...) -> char(&)[2];
26
27 static_assert(sizeof(f<void>(0)) != 1, "");