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.

Reply via email to