This is the mail archive of the gcc-patches@gcc.gnu.org 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


Hi,

On 09/09/2013 12:13 PM, Richard Biener wrote:
Everything happens via call backs. Thus from the generic diagnostic machinery,
you go to cp_printer for C++, thus location_of for C++. In C is different, but
again there is, evidently, a mechanism which uses DECL_CONTEXT for PARM_DECLs
which leads to an inaccurate location when we *really* want the location of
the parameter (exactly as I explained for C++).
I understand that.  But I question it.  Why would that ever be useful?
Can't the places that want that simply use warning/error_at with the
proper location?
Indeed, this is *exactly*, if I understand him correctly, what Manuel says: looking forward he thinks we should not have this magic relying on '+' and things happening behind the scenes, simply explicit locations and warning_at/error_at.

For the time being, however, we are stuck with the situation that relying on '+' in this case (like in *many* existing others) doesn't work, because, in C++, location_of does t = DECL_CONTEXT (t) which is almost right but not really, we want the location of the PARM_DECL. The C front-end does something very similar (as the inaccurate location shows).

What do you think?

Paolo.


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