From: paolo Date: Thu, 18 Dec 2014 23:43:46 +0000 (+0000) Subject: 2014-12-18 Paolo Carlini X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=54a210e08807f4a826097a7eab5bdb22653f8bc9;p=thirdparty%2Fgcc.git 2014-12-18 Paolo Carlini PR c++/59204 * g++.dg/cpp0x/sfinae53.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218878 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 24696e0e67c9..878a82e508cf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-12-18 Paolo Carlini + + PR c++/59204 + * g++.dg/cpp0x/sfinae53.C: New. + 2014-12-18 Vladimir Makarov PR rtl-optimization/64291 diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae53.C b/gcc/testsuite/g++.dg/cpp0x/sfinae53.C new file mode 100644 index 000000000000..19b00cf0c583 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/sfinae53.C @@ -0,0 +1,23 @@ +// PR c++/59204 +// { dg-do compile { target c++11 } } + +template< class T > + using void_t = void; + +template< class T, class = void > + struct has_type +{ constexpr static bool value = false; }; + +template< class T > + struct has_type> +{ constexpr static bool value = true; }; + +struct yes { using type = int; }; +struct no { }; + +int +main( ) +{ + static_assert( has_type::value, "false negative!" ); + static_assert( not has_type::value, "false positive!" ); +}