RFA: fix valgrind failures 3/3 (cp_parser_initializer_clause)

Mark Mitchell mark@codesourcery.com
Wed Jan 26 18:14:00 GMT 2005


Joern RENNECKE wrote:
> Zack Weinberg wrote:
> 
>>   
>> I think this should go in cp_parser_initializer_list instead of
>> cp_parser_initializer_clause.  It seems to be the convention that the
>> callers of cp_parser_initializer_clause are responsible for default-
>> clearing this flag.
>>
> That is not what the start-of-function comments say.  In front of 
> cp_parser_initializer_clause
> they say: NON_CONSTANT_P is as for cp_parser_initializer.
> 
> And in front of cp_parser_initializer, they say:
> If there is an
>   initializer, and it is not a constant-expression, *NON_CONSTANT_P
>   is set to true; otherwise it is set to false.

I think that things have changed; it used to be that callers were 
responsible for clearing the flag, but now it looks like it would be OK 
to do it in c_p_i_c.  This changed when cp_parser_initializer_list got 
clause_non_constant_p, instead of passing down non_constant_p.  So, 
Joern's patch is OK, provided it passes tests.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304



More information about the Gcc-patches mailing list