[Bug c++/54928] Infinite output with after ICE with macro
manu at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Oct 16 18:00:00 GMT 2012
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.
More information about the Gcc-bugs
mailing list