aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/sfinae26.C
blob: 42b48eb5a6b27a49a61e102a68fe84098d17d671 (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
32
33
34
35
36
37
38
// PR c++/49229
// { dg-options -std=c++0x }

extern void* enabler;

template<bool, class = void>
struct enable_if {};

template<class T>
struct enable_if<true, T> {
  typedef T type;
};

template<class... Bn>
struct and_;

template<class B1>
struct and_<B1> : B1 {};

template<class, class>
struct is_same {
  static constexpr bool value = false;
};

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

template<class... T>
struct S {
  template<class... U,
    typename enable_if<and_<is_same<T, U>...>::value>::type*& = enabler
  >
  S(U...){}			// { dg-error "no type named 'type'" }
};

S<bool> s(0);			// { dg-error "no match" }