gcc/testsuite/g++.dg/cpp0x/sfinae65.C
raw| 1 | // PR c++/86932 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template<bool, typename T> struct enable_if { using type = T; }; |
| 5 | template<typename T> struct enable_if<false, T> { }; |
| 6 | |
| 7 | template<typename> struct is_foo { static constexpr bool value = false; }; |
| 8 | |
| 9 | // { dg-error "enable_if" "" { target *-*-* } .+1 } |
| 10 | template<class U, typename enable_if<is_foo<U>::value, int>::type...> void f() {} |
| 11 | |
| 12 | int main() |
| 13 | { |
| 14 | f<int>(); // { dg-error "no match" } |
| 15 | } |