[cfe-commits] [patch] Fix "note" of a duplicate explicit instantiation definition following a specialization

Nico Weber thakis at chromium.org
Mon Jan 2 09:08:27 PST 2012


On Tue, Dec 27, 2011 at 7:45 AM, Hans Wennborg <hans at chromium.org> wrote:
> On Sat, Dec 24, 2011 at 12:13 AM, Nico Weber <thakis at chromium.org> wrote:
>> Hi,
>>
>> the attached patch fixes the note printed in the error message in
>>
>>  namespace SII_WithDefinedTemplate {
>>    template <typename STRING_TYPE> class BasicStringPiece {};
>>    template <> class BasicStringPiece<int> { };
>>    template class BasicStringPiece<int>;  // expected-note {{previous
>> explicit instantiation is here}}
>>    template class BasicStringPiece<int>;  // expected-error
>> {{duplicate explicit instantiation of 'BasicStringPiece<int>'}}
>>  }
>>
>> Without this, clang says "Note: Previous explicit instantiation is
>> here" and nothing after that.
>>
>> (It's a bit weird that this is an error given that the first explicit
>> instantiation definition counts as a no-op, but that matches existing
>> behavior.)
>
>
>> +/// \brief Compute the diagnostic location for an explicit instantiation
>> +//  declaration or definition.
>
> Another slash here?
>
>> +static SourceLocation DiagLocForExplicitInstantiation(
>> +    NamedDecl* Decl, SourceLocation PointOfInstantiation) {
>
> The star goes on the parameter name.

Both done.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-sii-diag.patch
Type: application/octet-stream
Size: 3704 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120102/decbc077/attachment.obj>


More information about the cfe-commits mailing list