Jason Merrill <ja...@redhat.com> writes:

> On 07/04/2014 05:13 AM, Dodji Seketeli wrote:
>>> >// preprocessed output
>>> ># 3 "test.cpp" 3 4
>>> >sys_token
>>> ># 3 "test.cpp"
>>> >3
>>> ># 3 "test.cpp" 3 4
>>> >sys_token
>
>> Yeah.  For Built-in tokens that are expanded like that we only do track
>> their the location of their expansion, not their spelling location.  So
>> this behaviour is expected as well.
>
> But surely you can do something to avoid this useless line marker in
> this case?  A built-in token should never require a line change.

What triggers the line change is the *expansion* of the built-in macro
__LINE__.

That is, the token "3".  As the existing location tracking facility
doesn't track the locations for tokens originating from the expansion of
built-in macros, the relationship "3" -> __LINE__ is lost.

My understanding is that to avoid emitting the line marker in this case,
we'd need to track the "3" -> __LINE__ relationship so that we can
detect that "3" is the expansion of the built-in macro__LINE__.

This would be a separate patch that I'd need to work on and test
separately I guess.

Should that prevent this patch to go in now?

-- 
                Dodji

Reply via email to