re PR c++/85147 (ICE with invalid variadic template-template parameter)
authorJakub Jelinek <jakub@redhat.com>
Tue, 3 Apr 2018 16:22:05 +0000 (18:22 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 3 Apr 2018 16:22:05 +0000 (18:22 +0200)
PR c++/85147
* pt.c (fixed_parameter_pack_p_1): Punt if parm is error_mark_node.

* g++.dg/cpp0x/pr85147.C: New test.

From-SVN: r259040

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr85147.C [new file with mode: 0644]

index d9406bfe962d1818290fe507b3872f49ae68000c..ff3af265c95b9d7bcd6fc155d5a55fbb3e978490 100644 (file)
@@ -1,5 +1,8 @@
 2018-04-03  Jakub Jelinek  <jakub@redhat.com>
 
+       PR c++/85147
+       * pt.c (fixed_parameter_pack_p_1): Punt if parm is error_mark_node.
+
        PR c++/85140
        * name-lookup.c (handle_namespace_attrs): Return early if attributes
        is error_mark_node.
index 284eaf3cab66e04f6ccdf15ffa70e53f3b855828..f4edb39f6e3236035ad8dff7182c4d92d415e492 100644 (file)
@@ -5101,7 +5101,7 @@ static void
 fixed_parameter_pack_p_1 (tree parm, struct find_parameter_pack_data *ppd)
 {
   /* A type parm can't refer to another parm.  */
-  if (TREE_CODE (parm) == TYPE_DECL)
+  if (TREE_CODE (parm) == TYPE_DECL || parm == error_mark_node)
     return;
   else if (TREE_CODE (parm) == PARM_DECL)
     {
index e2a7cf276cb8a4e2705e3c7ce7396302b20cf548..70fd513d469c18db49dba587b68e61eea85c435f 100644 (file)
@@ -1,5 +1,8 @@
 2018-04-03  Jakub Jelinek  <jakub@redhat.com>
 
+       PR c++/85147
+       * g++.dg/cpp0x/pr85147.C: New test.
+
        PR c++/85140
        * g++.dg/cpp0x/gen-attrs-64.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr85147.C b/gcc/testsuite/g++.dg/cpp0x/pr85147.C
new file mode 100644 (file)
index 0000000..68c0022
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/85147
+// { dg-do compile { target c++11 } }
+
+template<typename T> struct A
+{
+  template<template<...T> class...> struct B {};       // { dg-error "expected|mismatch" }
+};
+
+A<int>::B<> b;                                         // { dg-error "does not name a template type" }