This is the mail archive of the gcc-bugs@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]

[Bug c++/54928] Infinite output with after ICE with macro


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.


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