From: Paolo Carlini Date: Fri, 31 Aug 2007 09:55:43 +0000 (+0000) Subject: re PR c++/32113 (ICE with invalid template parameter) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc92563c9c64cc9f33bcec4b3230ef63725a1085;p=thirdparty%2Fgcc.git re PR c++/32113 (ICE with invalid template parameter) /cp 2007-08-31 Paolo Carlini PR c++/32113 * search.c (lookup_member): Check the name argument for error_mark_node. /testsuite 2007-08-31 Paolo Carlini PR c++/32113 * g++.dg/template/crash70.C: New. From-SVN: r127965 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3285436a6fcf..02af49f8d39b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-31 Paolo Carlini + + PR c++/32113 + * search.c (lookup_member): Check the name argument for + error_mark_node. + 2007-08-24 Jakub Jelinek PR c++/31941 diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 0cfd51394524..259ec66205f5 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -1200,6 +1200,9 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type) const char *errstr = 0; + if (name == error_mark_node) + return NULL_TREE; + gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE); if (TREE_CODE (xbasetype) == TREE_BINFO) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a4cbd9728b6a..97e73bd22d99 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-08-31 Paolo Carlini + + PR c++/32113 + * g++.dg/template/crash70.C: New. + 2007-08-24 Jakub Jelinek PR middle-end/32912 diff --git a/gcc/testsuite/g++.dg/template/crash70.C b/gcc/testsuite/g++.dg/template/crash70.C new file mode 100644 index 000000000000..742f77b22252 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/crash70.C @@ -0,0 +1,7 @@ +// PR c++/32113 + +template struct A; + +template void foo (A<&T::template i>); // { dg-error "not a template" } + +template void foo > (A<0>); // { dg-error "does not match" }