Several obversations can be made in that hypothetical example.
- The location mentioned in the error message
test.c:5:14: error: invalid operands to binary<< (have âdoubleâ and âintâ)
is the spelling location of the token '<<'. I believe this makes more
sense than the original behaviour.
Agreed. However, I suspect some will disagree and it may cause havoc
in automated code that parses error messages. Presumably there's a
way to get the old behavior, even if you're tracking all three
locations?
The linemap API allows us to get the old behaviour (i.e, resolve virtual
locations to the macro expansion point). But as most of the client code
does that through the expand_location function, I wasn't sure how to
introduce choice there in a convenient way. Maybe I should add another
flag to control the "user interface" so to speak?