This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/13536] [3.4 regression] parse error when parenthesized construction-style cast contains old-style cast


------- Additional Comments From steven at gcc dot gnu dot org  2004-01-04 09:36 -------
This hunk of the patch to parser.c causes the problem:  
30a31,47  
> @@ -10900,6 +10905,16 @@  
>        bool saved_default_arg_ok_p = parser->default_arg_ok_p;  
>        parser->default_arg_ok_p = false;  
>  
> +      /* After seeing a decl-specifier-seq, if the next token is not a  
> +      "(", there is no possibility that the code is a valid  
> +      expression initializer.  Therefore, if parsing tentatively,  
> +      we commit at this point.  */  
> +      if (!parser->in_template_argument_list_p  
> +       && cp_parser_parsing_tentatively (parser)  
> +       && !cp_parser_committed_to_tentative_parse (parser)  
> +       && cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_PAREN))  
> +     cp_parser_commit_to_tentative_parse (parser);  
> +      /* Parse the declarator.  */  
>        declarator = cp_parser_declarator (parser,  
>                                        CP_PARSER_DECLARATOR_EITHER,  
>                                        /*ctor_dtor_or_conv_p=*/NULL,  
  
Making this P1 since it's a regression and a rejects-valid bug.  
  
Assigned to Mark since this was his patch.  
 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mmitchel at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13536


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]