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

Re: [Patch to gcc/function] PR 58362


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":

    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...


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