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 3/7] Emit macro expansion related diagnostics


Jason Merrill <jason@redhat.com> writes:

> On 09/21/2011 02:32 PM, Dodji Seketeli wrote:
>> FWIW, I'd like the LRK_MACRO_PARM_REPLACEMENT name (or its
>> replacement.  ha ha) to hint at the fact that it really has to do with
>> a token that is an /argument/ for a function-like macro.
>
> I disagree; arguments are the situation when the two locations differ,
> but this one (yI) is always the source location in the macro
> definition

I think an interesting question to ask here is "the source location of
what exactly?".

The value of the source location is always the same, yes, but its
meaning is different depending on if the token in question is an
argument or not.

When the token is not an argument, then yI is a source location for *that*
token in the macro definition.  It's then the spelling location for the
token in question.

When the token is an argument, then yI is a source location for
*another* token.  Namely, the parameter for that argument.  Not
necessarily the spelling location for the token we are observing.

> while the first one (xI) is either that or, for macro arguments, a
> virtual location.

Yes, but it's always a locus of the observed token.

Would LRK_MACRO_DEFINITION_LOCATION be better then?  :-)

-- 
		Dodji


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