From 244541410209602edc266168fdb1adba099eee88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez?= Date: Fri, 4 May 2012 00:31:55 +0000 Subject: [PATCH] re PR c++/24985 (caret diagnostics) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 2012-05-04 Manuel López-Ibáñez PR c++/24985 gcc/ * tree-diagnostic.c (maybe_unwind_expanded_macro_loc): Show caret for macro expansion. From-SVN: r187134 --- gcc/ChangeLog | 6 ++++++ gcc/tree-diagnostic.c | 18 +++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8bd41019311..635e914b389 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-05-04 Manuel López-Ibáñez + + PR c++/24985 + * tree-diagnostic.c (maybe_unwind_expanded_macro_loc): Show caret + for macro expansion. + 2012-05-03 Manuel López-Ibáñez * flags.h (flag_permissive): Do not declare. diff --git a/gcc/tree-diagnostic.c b/gcc/tree-diagnostic.c index 0a55925fb31..cbdbb778259 100644 --- a/gcc/tree-diagnostic.c +++ b/gcc/tree-diagnostic.c @@ -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); -- 2.30.2