[cfe-dev] Incorrect source range for specialized template VarDecl declaration
Richard Smith
richard at metafoo.co.uk
Tue Jan 8 18:17:16 PST 2013
On Tue, Jan 8, 2013 at 4:11 PM, Will Wilson <will at indefiant.com> wrote:
>
>> > 1. I assume the same is true for the whole if-else block in
>> > CheckMemberSpecialization() that applies TSK_ExplicitSpecialization for
>> > various Decl types?
>>
>> Yes, those calls to setLocation all look wrong. Do you see any test
>> failures if you remove them?
>
>
> Failing Tests (5):
> Clang :: CXX/temp/temp.spec/temp.expl.spec/p2-0x.cpp
> Clang :: CXX/temp/temp.spec/temp.expl.spec/p2.cpp
> Clang :: CXX/temp/temp.spec/temp.expl.spec/p5.cpp
> Clang :: CXX/temp/temp.spec/temp.explicit/p4.cpp
> Clang :: SemaCXX/warn-unused-filescoped.cpp
>
> It looks like a few diagnostics rely on the location data. All of the fails
> seem to be composed of the diagnostics moving from the specialization to the
> declaration (from test/CXX/temp/temp.spec/temp.expl.spec/p5.cpp):
>
> error: 'note' diagnostics expected but not seen:
> Line 31: forward declaration
> error: 'note' diagnostics seen but not expected:
> Line 15: forward declaration of 'X<IntHolder, long>::Inner'
> 2 errors generated.
>
> Obviously the tests could be fairly easily updated but it seems there's more
> than a little danger of adversely affecting utility of the diagnostics. I
> guess the diagnostics would have to be reworked to ensure they resolved the
> explicitly specialized definition rather than declaration location - which
> sounds like it might be a fair bit of work...
OK, that diagnostic change in particular looks bad. Seems this will
not be straightforward to fix. :(
More information about the cfe-dev
mailing list