[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-patches
Subject:    Re: [PATCH] Fix -Werror bootstrap problem with gcc 4.1 host compiler
From:       Dirk Mueller <dmueller () suse ! de>
Date:       2007-02-05 12:47:43
Message-ID: 200702051347.43761.dmueller () suse ! de
[Download RAW message or body]

On Monday, 5. February 2007 05:31, Mark Mitchell wrote:

> Would one of you be willing to test such a patch?  It's pre-approved,
> assuming it works.

I've bootstrapped the following patch successfully and applied it to mainline. 
Thanks!

2007-02-05  Dirk Mueller  <dmueller@suse.de>

	PR bootstrap/30510
	* parser.c (cp_parser_class_specifier): Always initialize bases.

--- parser.c	(revision 121595)
+++ parser.c	(working copy)
@@ -13398,6 +13398,10 @@ cp_parser_class_specifier (cp_parser* pa
      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))


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic