diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae26.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae26.C | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae26.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae26.C new file mode 100644 index 0000000..f55e1d8 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae26.C @@ -0,0 +1,38 @@ +// PR c++/49229 +// { dg-do compile { target c++11 } } + +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 // { dg-error "no type" } + > + S(U...){} +}; + +S<bool> s(0); // { dg-error "no match" } |