Debian Codegraph @

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

raw
1 // PR c++/90019
2 // { dg-do compile { target c++11 } }
3
4 template<bool, typename T = void>
5 struct enable_if { };
6 template<typename T>
7 struct enable_if<true, T> { typedef T type; };
8 template<bool C, typename T = void>
9 using __enable_if_t = typename enable_if<C, T>::type;
10 template<bool C, typename T = void>
11 using enable_if_t = typename enable_if<C, T>::type;
12
13 template <int I, enable_if_t<I == 0, int>...> void foo() {}
14 template <int I, enable_if_t<I != 0, int>...> void foo() {}
15 template <int I, int=0, enable_if_t<I == 0, int>...> void bar() {}
16 template <int I, int=0, enable_if_t<I != 0, int>...> void bar() {}
17
18 void test()
19 {
20 bar<0>();
21 bar<0,0>();
22 foo<0>();
23 }