aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <paolo@gcc.gnu.org>2015-03-24 10:50:36 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2015-03-24 10:50:36 +0000
commitcca38f293d982cb057d5ad000cdf1a0cf51558bb (patch)
tree5af1f769caca7d031758a91ff5a5f027cffaa9c5
parente72baed7e945f47609207ec8be4994e586e70649 (diff)
downloadgcc-cca38f293d982cb057d5ad000cdf1a0cf51558bb.zip
gcc-cca38f293d982cb057d5ad000cdf1a0cf51558bb.tar.gz
gcc-cca38f293d982cb057d5ad000cdf1a0cf51558bb.tar.bz2
re PR c++/59988 (Failing to specialize template class)
2015-03-24 Paolo Carlini <paolo.carlini@oracle.com> PR c++/59988 * g++.dg/cpp0x/vt-59988.C: New. From-SVN: r221623
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/vt-59988.C28
1 files changed, 28 insertions, 0 deletions
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 0000000..ab611f5
--- /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<template<typename...> class C, typename... T>
+struct is_valid_specialization {
+ typedef struct { char _; } yes;
+ typedef struct { yes _[2]; } no;
+
+ template<template<typename...> class D, typename... U>
+ static yes test(D<U...>*);
+ template<template<typename...> class D, typename... U>
+ static no test(...);
+
+ constexpr static bool value = (sizeof(test<C, T...>(0)) == sizeof(yes));
+};
+
+template<typename T>
+struct Test1 { };
+
+template<typename T1, typename T2>
+struct Test2 { };
+
+template<typename...>
+struct TestV { };
+
+static_assert(!is_valid_specialization<Test1, int>::value, "");
+static_assert(!is_valid_specialization<Test2, int>::value, "");
+static_assert(!is_valid_specialization<TestV, int>::value, "");