From 16d3151c9bbc1386a7cacae3aa31525ddd73913d Mon Sep 17 00:00:00 2001 From: paolo Date: Tue, 24 Mar 2015 10:50:36 +0000 Subject: [PATCH] 2015-03-24 Paolo Carlini PR c++/59988 * g++.dg/cpp0x/vt-59988.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221623 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/g++.dg/cpp0x/vt-59988.C | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/vt-59988.C diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-59988.C b/gcc/testsuite/g++.dg/cpp0x/vt-59988.C new file mode 100644 index 00000000000..ab611f5d865 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/vt-59988.C @@ -0,0 +1,28 @@ +// PR c++/59988 +// { dg-do compile { target c++11 } } + +template class C, typename... T> +struct is_valid_specialization { + typedef struct { char _; } yes; + typedef struct { yes _[2]; } no; + + template class D, typename... U> + static yes test(D*); + template class D, typename... U> + static no test(...); + + constexpr static bool value = (sizeof(test(0)) == sizeof(yes)); +}; + +template +struct Test1 { }; + +template +struct Test2 { }; + +template +struct TestV { }; + +static_assert(!is_valid_specialization::value, ""); +static_assert(!is_valid_specialization::value, ""); +static_assert(!is_valid_specialization::value, ""); -- 2.11.4.GIT