From: Kriang Lerdsuwanakij Date: Thu, 7 Aug 2003 14:36:39 +0000 (+0000) Subject: re PR c++/5767 (ICE with forwarding template template parameters) X-Git-Tag: releases/gcc-3.4.0~4353 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3adee96c46c8f70fb52de86775c1524654f10f22;p=thirdparty%2Fgcc.git re PR c++/5767 (ICE with forwarding template template parameters) PR c++/5767 * parser.c (cp_parser_class_name): Return immediately when scope is error_mark_node. * g++.dg/parse/crash11.C: New test. From-SVN: r70226 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 87f0107e023b..9c897331e6b2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2003-08-07 Kriang Lerdsuwanakij + + PR c++/5767 + * parser.c (cp_parser_class_name): Return immediately when scope + is error_mark_node. + 2003-08-07 Aldy Hernandez * cp/Make-lang.in (cp/call.o): Add dependency for target.h. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index fce69ca6fe68..12f541a73967 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -10957,6 +10957,9 @@ cp_parser_class_name (cp_parser *parser, /* PARSER->SCOPE can be cleared when parsing the template-arguments to a template-id, so we save it here. */ scope = parser->scope; + if (scope == error_mark_node) + return error_mark_node; + /* Any name names a type if we're following the `typename' keyword in a qualified name where the enclosing scope is type-dependent. */ typename_p = (typename_keyword_p && scope && TYPE_P (scope) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0e039d53916a..9c7ea3bd8166 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-08-07 Kriang Lerdsuwanakij + + PR c++/5767 + * g++.dg/parse/crash11.C: New test. + 2003-08-06 Alexandre Oliva * gcc.dg/cpp/spacing1.c: Update. diff --git a/gcc/testsuite/g++.dg/parse/crash11.C b/gcc/testsuite/g++.dg/parse/crash11.C new file mode 100644 index 000000000000..8e6c73b1e9c2 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/crash11.C @@ -0,0 +1,34 @@ +// { dg-do compile } + +// Origin: priesnit@math.uni-goettingen.de + +// PR c++/5767: ICE parsing typename with invalid scope. + +template