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 60383


Hi,

this 4.9 regression is again an ICE during error recovery: check_specialization_namespace errors out, maybe_process_partial_specialization doesn't check its return value, and the ICE happens much later, in retrieve_specialization, in the gcc_assert:

  /* There should be as many levels of arguments as there are
     levels of parameters.  */
  gcc_assert (TMPL_ARGS_DEPTH (args)
          == (TREE_CODE (tmpl) == TEMPLATE_DECL
          ? TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl))
          : template_class_depth (DECL_CONTEXT (tmpl))));

Simply checking the return value of check_specialization_namespace and early returning error_mark_node appears to work well, with the minor complication that check_specialization_namespace may return false also in case of permerror, thus the !at_namespace_scope_p. Other than that, the tweak to crash95.C doesn't seem bad to me (for example, it aligns our diagnostic to that of current clang)

Tested x86_64-linux.

Thanks,
Paolo.

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

Attachment: CL_60383
Description: Text document

Attachment: patch_60383
Description: Text document


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