On 05/23/2012 12:30 PM, Paolo Carlini wrote:
On 05/23/2012 06:30 AM, Jason Merrill wrote:
On 05/22/2012 05:18 PM, Paolo Carlini wrote:
Uhhm, I have an "out of the blue" idea, so please excuse me if for some
"obvious" reason doesn't make sense: don't we have a global variable
saying "where we are" in the compiler pipeline?

I'm not sure, but the question led me to thinking about only asserting if input_location != UNKNOWN_LOCATION. Would that work?
Ah, that would be a nice "implementation" of my vague idea! Thus, what I'm going to test, in warning_at & co is something like:

    gcc_assert (input_location == UNKNOWN_LOCATION
                           || location != UNKNOWN_LOCATION);
Not precise enough :(

Tests like gcc.dg/pr28322-2.c show that we may emit such line #0 warnings when input_location is already != UNKNOWN_LOCATION.

I'm afraid that for the next location changes in the C++ front-end I will resort to apply the temporarily apply the checks when regression testing the front-end.

Paolo.

Reply via email to