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: [patch] fix PR c++/14136: Duplicate error message


Volker Reichelt wrote:

Btw, the condition
(cp_parser_parsing_tentatively && !cp_parser_committed_to_tentative_parse)
appears in the parser quite often. Maybe we could make a function

  static bool
  cp_parser_parsing_really_tentatively (cp_parser* parser)
  {
    return (cp_parser_parsing_tentatively (parser)
	    && !cp_parser_committed_to_tentative_parse (parse));
  }

use

d) !cp_parser_parsing_really_tentatively

and clean up the rest.

This would definitely be a good cleanup. Although, I think that this new function should actually be called "cp_parser_parsing_tenatively", and the current function of that name should be renamed to something else. Perhaps "cp_parser_nested_context_p" which is a more accurate description of what it is testing.


--
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]