From cca38f293d982cb057d5ad000cdf1a0cf51558bb Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 24 Mar 2015 10:50:36 +0000 Subject: [PATCH] re PR c++/59988 (Failing to specialize template class) 2015-03-24 Paolo Carlini PR c++/59988 * g++.dg/cpp0x/vt-59988.C: New. From-SVN: r221623 --- 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.30.2