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]

[C++ Patch] PR 68722


Hi,

I'm having a look at this ICE during error recovery regression and I have a couple of different proposals which both pass testing. In the first case, instead of reaching (in cp_parser_cache_defarg):

  default_argument = make_node (DEFAULT_ARG);
  DEFARG_TOKENS (default_argument)
    = cp_token_cache_new (first_token, token);
  DEFARG_INSTANTIATIONS (default_argument) = NULL;

  return default_argument;

we could simply return an error_mark_node right after:

error_at (token->location, "file ends in default argument");

and certainly avoid the ICE in merge_exception_specifiers much later. Alternately, maybe it's too heavy handed, maybe fatal_errors are really appropriate in a very restrict set of cases (not sure), it would work to simply change the error_at to fatal_error, which also cuts some redundant diagnostic we produce right now after the sensible one about file ends. The idea occurred to me in particular because the error_at above does *not* result (and never did to my best knowledge) in a actual location being printed, we issue:

cc1plus: error: file ends in default argument

which smells like a fatal-type error message?!?

What do you think?

Thanks,
Paolo.

/////////////////////////

Attachment: CL_68722
Description: Text document

Attachment: patch_68722
Description: Text document

Attachment: patch_68722_alt
Description: Text document


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