This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch to gcc/function] PR 58362
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Mon, 09 Sep 2013 11:46:25 +0200
- Subject: Re: [Patch to gcc/function] PR 58362
- Authentication-results: sourceware.org; auth=none
- References: <522CCF1B dot 8080007 at oracle dot com> <alpine dot LNX dot 2 dot 00 dot 1309090945470 dot 3869 at zhemvz dot fhfr dot qr> <522D8BBC dot 608 at oracle dot com> <alpine dot LNX dot 2 dot 00 dot 1309091132340 dot 3869 at zhemvz dot fhfr dot qr>
Hi,
On 09/09/2013 11:33 AM, Richard Biener wrote:
How is '+' in %q+D defined? I failed to find documentation of the
diagnostic formats (but only searched for like two minutes).
You see, this is an issue ;) No seriously, in C++ I understand it by
looking at error.c:3438: when '+' is there, cp_printer use location_of
(t) instead of what is passed down in error_at or warning_at, etc. Then
if you go to location_of, in the same file, you see the reason of the
difference between DECL_SOURCE_LOCATION + "%qD" and "%q+D":
if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t))
t = DECL_CONTEXT (t);
else if ...
thus, in case of PARM_DECLs, t becomes DECL_CONTEXT (t), thus the
function declaration instead of the parameter declaration!!! See? (I'm
learning the details with you)
Now, I think we have two options: either we do more or less what Marc &
I & Manuel figured out, or we try to change the definition of
location_of, which impacts a lot of code...
Paolo.