]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/24985 (caret diagnostics)
authorManuel López-Ibáñez <manu@gcc.gnu.org>
Fri, 4 May 2012 00:31:55 +0000 (00:31 +0000)
committerManuel López-Ibáñez <manu@gcc.gnu.org>
Fri, 4 May 2012 00:31:55 +0000 (00:31 +0000)
2012-05-04  Manuel López-Ibáñez  <manu@gcc.gnu.org>

PR c++/24985
gcc/
* tree-diagnostic.c (maybe_unwind_expanded_macro_loc): Show caret
for macro expansion.

From-SVN: r187134

gcc/ChangeLog
gcc/tree-diagnostic.c

index 8bd41019311ff6b427729e3ff9d49e90fa98eba8..635e914b3896c713ad7309a63c4a02f7ff13cf6f 100644 (file)
@@ -1,3 +1,9 @@
+2012-05-04  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+       PR c++/24985
+       * tree-diagnostic.c (maybe_unwind_expanded_macro_loc): Show caret
+       for macro expansion.
+
 2012-05-03  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
        * flags.h (flag_permissive): Do not declare.
index 0a55925fb313412f8c4a54a5411e6e2ef2afcdf9..cbdbb778259b9673ddf4ee082d2b9111b75ea3a7 100644 (file)
@@ -187,30 +187,30 @@ maybe_unwind_expanded_macro_loc (diagnostic_context *context,
                                     LRK_MACRO_DEFINITION_LOCATION, NULL);
 
         saved_kind = diagnostic->kind;
-        saved_prefix = context->printer->prefix;
+        saved_prefix = pp_get_prefix (context->printer);
         saved_location = diagnostic->location;
 
         diagnostic->kind = DK_NOTE;
         diagnostic->location = resolved_def_loc;
-        pp_base_set_prefix (context->printer,
-                            diagnostic_build_prefix (context,
-                                                     diagnostic));
+        pp_set_prefix (context->printer,
+                       diagnostic_build_prefix (context, diagnostic));
         pp_newline (context->printer);
         pp_printf (context->printer, "in expansion of macro '%s'",
                    linemap_map_get_macro_name (iter->map));
         pp_destroy_prefix (context->printer);
+        diagnostic_show_locus (context, diagnostic);
 
         diagnostic->location = resolved_exp_loc;
-        pp_base_set_prefix (context->printer,
-                            diagnostic_build_prefix (context,
-                                                     diagnostic));
+        pp_set_prefix (context->printer,
+                       diagnostic_build_prefix (context, diagnostic));
         pp_newline (context->printer);
-        pp_printf (context->printer, "expanded from here");
+        pp_string (context->printer, "expanded from here");
         pp_destroy_prefix (context->printer);
+        diagnostic_show_locus (context, diagnostic);
 
         diagnostic->kind = saved_kind;
         diagnostic->location = saved_location;
-        context->printer->prefix = saved_prefix;
+        pp_set_prefix (context->printer, saved_prefix);
       }
 
   VEC_free (loc_map_pair, heap, loc_vec);