[PATCH] D49085: [Sema] Emit a diagnostic for an invalid dependent function template specialization

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 19 13:03:07 PDT 2018


rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.

LGTM.



================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:4111
+  "candidate template ignored: %select{template is not a function template"
+  "|is not a member of the enclosing namespace}0">;
 
----------------
erik.pilkington wrote:
> rjmccall wrote:
> > Your first explanation has a subject, but the second doesn't.  And I think it would be nice to suggest adding explicit scope qualification in the second case.
> > 
> > I assume non-templates have previously been filtered out?
> Oh, no, good point. A non-template can still get into here:
> ```
> namespace ns1 { template <class T> struct foo {}; }
> namespace ns2 { int foo() {} } // bad diag: template is not a function template
> using ns1::foo;
> using ns2::foo;
> 
> template <class T> class A {
>     friend void foo<T>() {}
> };
> ```
> 
> I added this to the testcases.
Thanks, these look great.


https://reviews.llvm.org/D49085





More information about the cfe-commits mailing list