re PR c++/68884 (template of value template crashes the compiler)
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 18 Oct 2017 07:43:06 +0000 (07:43 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 18 Oct 2017 07:43:06 +0000 (07:43 +0000)
2017-10-18  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/68884
* g++.dg/cpp0x/variadic-crash4.C: New.

From-SVN: r253843

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/variadic-crash4.C [new file with mode: 0644]

index d5fc8d8e44ade89d73a374dcaafc8549204b62fc..cd8a3e65fedb1628e32bac7904593c9a1bf44086 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-18  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/68884
+       * g++.dg/cpp0x/variadic-crash4.C: New.
+
 2017-10-18  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/79474
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-crash4.C b/gcc/testsuite/g++.dg/cpp0x/variadic-crash4.C
new file mode 100644 (file)
index 0000000..2974fe9
--- /dev/null
@@ -0,0 +1,14 @@
+// PR c++/68884
+// { dg-do compile { target c++11 } }
+
+namespace std {
+  template <typename _Tp, _Tp __v> struct A { static constexpr _Tp value = __v; };
+typedef A<bool, true> true_type;
+}
+template <int> struct VsA;
+template <class ValueType> struct ValueTemplate {
+  template <template <ValueType> class, class> struct IsInstanceOf;
+  template <template <ValueType> class TemplateA, ValueType... TypesA>
+  struct IsInstanceOf<TemplateA, TemplateA<TypesA...>> : std::true_type {};
+};
+bool foo = ValueTemplate<int>::IsInstanceOf<VsA, VsA<0>>::value;