]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c++/85147 (ICE with invalid variadic template-template parameter)
authorJakub Jelinek <jakub@redhat.com>
Mon, 25 Jun 2018 17:42:51 +0000 (19:42 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 25 Jun 2018 17:42:51 +0000 (19:42 +0200)
Backported from mainline
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.

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

From-SVN: r262090

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

index 3078b4a05c5331975774495940ef941fff31d035..9c7127b35c89de229dfdfb1a7eea036230a8c79e 100644 (file)
@@ -3,6 +3,9 @@
        Backported from mainline
        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 5d32c79ac20f8940096d6ff774bce78ce3f13bf7..499d48166ab79b58c691a2cc577f154459b13960 100644 (file)
@@ -4784,7 +4784,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 152e04c2234bbbd8b7f36cfa42b53845b49efcb9..4d9de83dbcca246c68327e52192fcd55f51085c1 100644 (file)
@@ -3,6 +3,9 @@
        Backported from mainline
        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" }