This is the mail archive of the
mailing list for the GCC project.
Re: [C++, diagnostic Patch] PR 58362
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 9 Sep 2013 07:57:33 -0500
- Subject: Re: [C++, diagnostic Patch] PR 58362
- Authentication-results: sourceware.org; auth=none
- References: <522DC3C2 dot 7010601 at oracle dot com>
On Mon, Sep 9, 2013 at 7:49 AM, Paolo Carlini <email@example.com> wrote:
> Hi all, hi Gaby,
> thus a more sensible try at fixing this issue:
> function.c:do_warn_unused_parameter uses "%q+D" for the error call. That
> means that cp/error.c:cp_printer does:
> if (set_locus && t != NULL)
> *text->locus = location_of (t);
> and it's important that location_of (t) is correct. However, for PARM_DECLs,
> location_of (still) does:
> if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t))
> t = DECL_CONTEXT (t);
> else if ...
> which means that for those we end up with the location of a FUNCTION_DECL or
> anyway not exactly the location of the PARM_DECL itself. I went through the
> C++ front-end and currently there are very few cases if any where
> location_of may be fed a PARM_DECL, and the very few seem Ok to me. The
> testsuite passes on x86_64-linux of course, thus I'm proposing the below.
> IMHO now that we are in Stage 1 the risk of breaking locations somewhere
> else is low enough. By the way, as discussed today elsewhere, the C
> front-end is already Ok.
Patch OK; thanks!