[PATCH] D16989: Change interpretation of function definition in friend declaration of template class.

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Mon May 30 12:12:14 PDT 2016


sepavloff marked 2 inline comments as done.
sepavloff added a comment.

In http://reviews.llvm.org/D16989#432282, @rsmith wrote:

> Please also add some testcases for the corresponding case for a friend function template:
>
>   template<typename T> void f();
>   template<typename> struct A {
>     template<typename T> void f() {}
>   };
>   template<typename> struct B {
>     template<typename T> void f() {}
>   };
>   A<int> a;
>   B<int> b; // ill-formed


Templates follow very different path. In the code you provided definitions for functions `f` are not generated, because they are not used, so diagnostics of such cases require special processing. Patch for template friends will be prepared soon.


http://reviews.llvm.org/D16989





More information about the cfe-commits mailing list