summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/sfinae23.C
blob: 4e2ea88b171dd85ba380f9a7ef3aa643d85f2fbc (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-options -std=c++0x }

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));