This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54928] Infinite output with after ICE with macro
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 16 Oct 2012 17:59:57 +0000
- Subject: [Bug c++/54928] Infinite output with after ICE with macro
- Auto-submitted: auto-generated
- References: <bug-54928-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54928
--- Comment #7 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2012-10-16 17:59:57 UTC ---
This is the problem:
Index: tree-diagnostic.c
===================================================================
--- tree-diagnostic.c (revision 192379)
+++ tree-diagnostic.c (working copy)
@@ -239,10 +239,13 @@ maybe_unwind_expanded_macro_loc (diagnos
pp_destroy_prefix (context->printer);
diagnostic_show_locus (context, diagnostic);
/* At this step, as we've printed the context of the macro
definition, we don't want to print the context of its
expansion, otherwise, it'd be redundant. */
+ diagnostic->kind = saved_kind;
+ diagnostic->location = saved_location;
+ pp_set_prefix (context->printer, saved_prefix);
continue;
}
diagnostic->location = resolved_exp_loc;
pp_set_prefix (context->printer,
But I think the code can be a lot simpler with a slightly more complex patch.