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

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");
OpenPOWER on IntegriCloud