From: Paolo Carlini Date: Tue, 24 Mar 2015 10:50:36 +0000 (+0000) Subject: re PR c++/59988 (Failing to specialize template class) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cca38f293d982cb057d5ad000cdf1a0cf51558bb;p=gcc.git 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 --- 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, "");