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 51370


Hi,

in this minor diagnostic regression we ICE in dump_decl when we try to print the template arguments, which in this case are just error_mark_node, nothing sensible, not a TREE_VEC actually (the user entered repeated <int int>).

The fix I'm proposing for 4.7.0 seems to me very safe but for 4.8 we may want to revisit these things, maybe we want to keep the invariant that even in error conditions the arguments are always stored in a TREE_VEC (I *think* we used to have it, we should investigate whether we gave up on purpose) or something else entirely, like managing to not instantiate at all.

For your immediate curiosity, the error_mark_node is created in tsubst_template_args:9687 but that is done in various situations, for packs too, I don't feel like fiddling with it just now (and simply removing it for sure leads to worse diagnostics for eg, typename7.C)

Tested x86_64-linux.

Thanks,
Paolo.

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

Attachment: CL_51370
Description: Text document

Attachment: patch_51370
Description: Text document


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