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 58448


Hi,

this ICE is caused by error_mark_node as TREE_TYPE of a TYPE_DECL, which leads to a crash at the beginning of the TYPE_DECL case of tsubst_decl.

I tried various approaches - for example turning all error_operand_p (t) == true arguments passes to tsubst into error_mark_nodes also works - but I think I have a weak preference for the solution below, because conceptually matches the section of grokdeclarator beginning with:

  /* If this is declaring a typedef name, return a TYPE_DECL.  */
  if (typedef_p && decl_context != TYPENAME)

which seems rather special in terms of producing such TYPE_DECLs in case of errors (it does that for error recovery reasons, I suppose: just returning error_mark_node leads to worse diagnostic for eg, parse/error32.C).

Tested x86_64-linux.

Thanks,
Paolo.

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

Attachment: CL_58448
Description: Text document

Attachment: patch_58448
Description: Text document


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