[PATCH] D16579: Warn if friend function depends on template parameters.

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 17 06:00:24 PST 2016


Any feedback?

Thanks,
--Serge

2016-01-26 20:55 GMT+06:00 Serge Pavlov <sepavloff at gmail.com>:

> sepavloff created this revision.
> sepavloff added a subscriber: cfe-commits.
>
> Declaration of friend function may depend on template parameters,
> however it does not become a template function:
>
>     template<typename T> class C1 {
>       friend void func(T x);
>     };
>
> It may be not obvious for user, so compiler could emit a warning in
> such case. This patch implements appropriate warning, the wording is
> taken from GCC message. The patch fixes PR23342.
>
> http://reviews.llvm.org/D16579
>
> Files:
>   include/clang/Basic/DiagnosticGroups.td
>   include/clang/Basic/DiagnosticSemaKinds.td
>   lib/Sema/SemaDecl.cpp
>   test/CXX/drs/dr3xx.cpp
>   test/CXX/drs/dr5xx.cpp
>   test/CXX/temp/temp.decls/temp.friend/p1.cpp
>   test/PCH/cxx-templates.cpp
>   test/PCH/cxx-templates.h
>   test/SemaCXX/friend.cpp
>   test/SemaCXX/overload-call.cpp
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160217/ede35e39/attachment.html>


More information about the cfe-commits mailing list