parser.c (cp_parser_nested_name_specifier): Reset scope on failure.

cp:
	* parser.c (cp_parser_nested_name_specifier): Reset scope on
	failure.
	(cp_parser_elaborated_type_specifier): Likewise.
testsuite:
	* g++.dg/parse/crash10: New test.

From-SVN: r69702
This commit is contained in:
Nathan Sidwell 2003-07-23 13:02:34 +00:00 committed by Nathan Sidwell
parent e1a4d10fc0
commit eb5abb3944
4 changed files with 27 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2003-07-23 Nathan Sidwell <nathan@codesourcery.com>
PR c++/10953
* parser.c (cp_parser_nested_name_specifier): Reset scope on
failure.
(cp_parser_elaborated_type_specifier): Likewise.
2003-07-22 Mark Mitchell <mark@codesourcery.com>
Eliminate use of POINTER_TYPE for pointers-to-members.

View File

@ -3052,6 +3052,7 @@ cp_parser_nested_name_specifier (cp_parser *parser,
if (!scope)
{
cp_parser_error (parser, "expected nested-name-specifier");
parser->scope = NULL_TREE;
return error_mark_node;
}
@ -8439,7 +8440,10 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
identifier = cp_parser_identifier (parser);
if (identifier == error_mark_node)
return error_mark_node;
{
parser->scope = NULL_TREE;
return error_mark_node;
}
/* For a `typename', we needn't call xref_tag. */
if (tag_type == typename_type)

View File

@ -1,3 +1,7 @@
2003-07-23 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/parse/crash10: New test.
2003-07-22 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/ext/flexary1.C: New test.

View File

@ -0,0 +1,11 @@
// { dg-do compile }
// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 22 Jul 2003 <nathan@codesourcery.com>
// PR c++ 10953. ICE
class
{
typename:: // { dg-error "" "" }
; // { dg-error "" "" }