[C++ Patch] PR 44516

Gabriel Dos Reis gdr@integrable-solutions.net
Wed May 16 17:06:00 GMT 2012


On Wed, May 16, 2012 at 11:56 AM, Manuel López-Ibáñez
<lopezibanez@gmail.com> wrote:
> On 16 May 2012 17:41, Jason Merrill <jason@redhat.com> wrote:
>> On 05/16/2012 06:54 AM, Paolo Carlini wrote:
>>>
>>> isn't the diagnostic machinery able to cope with UNKNOWN_LOCATION? By
>>> default should be interpreted as input_location, no?
>>
>>
>> That would make sense to me; I don't know if it works that way now, though.
>
> No, I don't think it works that way. In fact, if something printed in
> diagnostics has an unknown location, that seems a bug, because either
> it is some artificial construct that we should not be giving
> diagnostics about, or the location passed down is wrong. Of course,
> for release compilers, we could add a check in
> diagnostic_report_diagnostic() and use input_location instead. For
> development compilers we could have a gcc_checking_assert(location !=
> UNKNOWN_LOCATION). But I am not sure what would happen for such a
> check.

hmm; triggering assertions while reporting diagnostics has usually
been unfunny because this is the diagnostics: it is called when we
think there is something wrong with our internal data structures.
Rather, we should handle the situations gracefully.

-- Gaby



More information about the Gcc-patches mailing list