aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae23.C
blob: 53d5c9b0b2fd6bd48509b0f65675106198ef410b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// PR c++/48647
// { dg-do compile { target c++11 } }

template< class T >
T&& declval();

template< class T, class U >
decltype( true ? declval<T>() : declval<U>() ) test( int );

template< class T, class U >
void test( ... );


template< class T, class U >
struct is_same {
  static const bool value = false;
};

template< class T >
struct is_same<T, T> {
  static const bool value = true;
};

#define SA(X) static_assert ((X),#X)

typedef decltype( test<int*, double*>(0) ) void_expected;
SA ((is_same<void_expected, void>::value));
SA ((!is_same<void_expected, void*>::value));