This is the mail archive of the gcc-patches@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]

Re: RFA: fix valgrind failures 3/3 (cp_parser_initializer_clause)


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


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