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: [RFC] PR c/23722 bad error recovery with if blocks and else


>>>>> "Manuel" == Manuel LÃpez-IbÃÃez <lopezibanez@gmail.com> writes:

Manuel> +	case RID_ELSE:
Manuel> +	  if (parser->in_if_stmt) 
Manuel> +            {
Manuel> +              error ("expected %<}%> before %<else%>");

If you don't mind, please make the new error calls use %H, and pass in
an explicit location.  I just modified the C parser to do this
(almost) everywhere, and I'd rather we not go backwards here.

Manuel> +              c_parser_consume_token (parser);
Manuel> +              error ("%<else%> without a previous %<if%>");

For instance, here the appropriate location would be the 'else' token
itself.

thanks,
Tom


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