From 92c59b7466a8caeab26f239ba4b004e68700d92e Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 3 Apr 2018 18:22:05 +0200 Subject: [PATCH] re PR c++/85147 (ICE with invalid variadic template-template parameter) 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 | 3 +++ gcc/cp/pt.c | 2 +- gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/g++.dg/cpp0x/pr85147.C | 9 +++++++++ 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/pr85147.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d9406bfe962..ff3af265c95 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2018-04-03 Jakub Jelinek + 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. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 284eaf3cab6..f4edb39f6e3 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e2a7cf276cb..70fd513d469 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-04-03 Jakub Jelinek + 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 index 00000000000..68c0022d80a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr85147.C @@ -0,0 +1,9 @@ +// PR c++/85147 +// { dg-do compile { target c++11 } } + +template struct A +{ + template class...> struct B {}; // { dg-error "expected|mismatch" } +}; + +A::B<> b; // { dg-error "does not name a template type" } -- 2.30.2