On 07/10/2014 08:13 AM, Dodji Seketeli wrote:
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.

So what is the location of "3" in this case? It seems to me that it doesn't really have its own location, and so we should be able to use whatever the current location is and not emit a line note.

Jason

Reply via email to