1 // PR c++/48647 2 // { dg-do compile { target c++11 } } 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)); 29