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

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 25 22:20:02 PST 2016


Could someone provide a 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/20160226/94f0b5ba/attachment.html>


More information about the cfe-commits mailing list