From 4595a3b391fe21e49b0214d68e8f622739b0517e Mon Sep 17 00:00:00 2001 From: mueller Date: Mon, 5 Feb 2007 12:43:17 +0000 Subject: [PATCH] 2007-02-05 Dirk Mueller PR bootstrap/30510 * parser.c (cp_parser_class_specifier): Always initialize bases. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121596 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/parser.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index bd78f58..00892e9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2007-02-05 Dirk Mueller + + PR bootstrap/30510 + * parser.c (cp_parser_class_specifier): Always initialize bases. + 2007-02-05 Paolo Bonzini * cp-tree.h (OMP_ATOMIC_CODE): Delete. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index f7bff07..6aef931 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -13398,6 +13398,10 @@ cp_parser_class_specifier (cp_parser* parser) class-key attributes nested-name-specifier [opt] template-id base-clause [opt] + Upon return BASES is initialized to the list of base classes (or + NULL, if there are none) in the same form returned by + cp_parser_base_clause. + Returns the TYPE of the indicated class. Sets *NESTED_NAME_SPECIFIER_P to TRUE iff one of the productions involving a nested-name-specifier was used, and FALSE otherwise. @@ -13432,6 +13436,8 @@ cp_parser_class_head (cp_parser* parser, type. */ num_templates = 0; + *bases = NULL_TREE; + /* Look for the class-key. */ class_key = cp_parser_class_key (parser); if (class_key == none_type) @@ -13722,7 +13728,6 @@ cp_parser_class_head (cp_parser* parser, struct A::C : B {}; is valid. */ - *bases = NULL_TREE; /* Get the list of base-classes, if there is one. */ if (cp_lexer_next_token_is (parser->lexer, CPP_COLON)) -- 2.7.4