Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/sfinae26.C

raw
1 // PR c++/49229
2 // { dg-do compile { target c++11 } }
3
4 extern void* enabler;
5
6 template<bool, class = void>
7 struct enable_if {};
8
9 template<class T>
10 struct enable_if<true, T> {
11 typedef T type;
12 };
13
14 template<class... Bn>
15 struct and_;
16
17 template<class B1>
18 struct and_<B1> : B1 {};
19
20 template<class, class>
21 struct is_same {
22 static constexpr bool value = false;
23 };
24
25 template<class T>
26 struct is_same<T, T> {
27 static constexpr bool value = true;
28 };
29
30 template<class... T>
31 struct S {
32 template<class... U,
33 typename enable_if<and_<is_same<T, U>...>::value>::type*& = enabler // { dg-error "no type" }
34 >
35 S(U...){}
36 };
37
38 S<bool> s(0); // { dg-error "no match" }