OSDN Git Service

PR c++/50941
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / sfinae23.C
1 // PR c++/48647
2 // { dg-options -std=c++0x }
3
4 template< class T >
5 T&& declval();
6
7 template< class T, class U >
8 decltype( true ? declval<T>() : declval<U>() ) test( int );
9
10 template< class T, class U >
11 void test( ... );
12
13
14 template< class T, class U >
15 struct is_same {
16   static const bool value = false;
17 };
18
19 template< class T >
20 struct is_same<T, T> {
21   static const bool value = true;
22 };
23
24 #define SA(X) static_assert ((X),#X)
25
26 typedef decltype( test<int*, double*>(0) ) void_expected;
27 SA ((is_same<void_expected, void>::value));
28 SA ((!is_same<void_expected, void*>::value));