aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae17.C
blob: c56a5d4198cf29cdebc76810a601fda558c828f0 (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
29
30
31
// PR c++/48530
// { dg-do compile { target c++11 } }

template<class T,
	 class = decltype(T{})
>
char f(int);

template<class>
char (&f(...))[2];

struct DelDtor {
  ~DelDtor() = delete;
};

static_assert(sizeof(f<DelDtor[2]>(0)) != 1, "Error");

struct A
{
  static DelDtor *p;
};

template<class T,
	 class = decltype(delete T::p, (T*)0)
>
char g(int);

template<class>
char (&g(...))[2];

static_assert(sizeof(g<DelDtor>(0)) != 1, "Error");