From: Jakub Jelinek Date: Tue, 3 Apr 2018 16:22:05 +0000 (+0200) Subject: re PR c++/85147 (ICE with invalid variadic template-template parameter) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=92c59b7466a8caeab26f239ba4b004e68700d92e;p=gcc.git 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 --- 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" }