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

2016-07-09 Thread Serge Pavlov via cfe-commits
sepavloff marked 6 inline comments as done. Comment at: include/clang/Sema/Sema.h:9469 @@ +9468,3 @@ + /// of proper templates, but they are needed for checks. + SmallVector FriendsOfTemplates; + Do we really need it? When compiler is compiling a module containi

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

2016-07-09 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 63387. sepavloff added a comment. Repared file modes. http://reviews.llvm.org/D16579 Files: include/clang/AST/TypeInstantiationMatcher.h include/clang/AST/TypeMatcher.h include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKind

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

2016-07-09 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 63386. sepavloff added a comment. Updated patch http://reviews.llvm.org/D16579 Files: include/clang/AST/TypeInstantiationMatcher.h include/clang/AST/TypeMatcher.h include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td

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

2016-05-09 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:1153 @@ +1152,3 @@ +def warn_non_template_friend : Warning<"friend declaration %q0 depends on " + "template parameter but is not a template function">, + InGroup; template func

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

2016-05-09 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 56607. sepavloff added a comment. Changed implementation of friend function set. Friend functions declared in template classes are not added to redeclaration chains, but access to them is needed to make some checks. This change allows using the set of frie

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

2016-04-04 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 52527. sepavloff added a comment. Updated patch Added a check for presence of template declaration corresponding to the friend function. Presence of similar functions but with specializations as argument types is also checked now. Made an atempt to make me

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

2016-03-19 Thread Serge Pavlov via cfe-commits
2016-03-18 0:35 GMT+06:00 Arthur O'Dwyer : > I'm not qualified to comment on the implementation, but I'm a bit > skeptical that this warning is appropriate in the first place. I've often > declared friend non-template functions, e.g. swap(). I've never intended to > declare a friend *template spec

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

2016-03-19 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 51017. sepavloff added a comment. Do not emit warning on class methods. 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/CX

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

2016-03-19 Thread Serge Pavlov via cfe-commits
Ping. Thanks, --Serge 2016-02-26 12:20 GMT+06:00 Serge Pavlov : > Could someone provide a feedback? > > Thanks, > --Serge > > 2016-01-26 20:55 GMT+06:00 Serge Pavlov : > >> sepavloff created this revision. >> sepavloff added a subscriber: cfe-commits. >> >> Declaration of friend function may dep

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

2016-03-19 Thread Arthur O'Dwyer via cfe-commits
I'm not qualified to comment on the implementation, but I'm a bit skeptical that this warning is appropriate in the first place. I've often declared friend non-template functions, e.g. swap(). I've never intended to declare a friend *template specialization*. Is declaring friend template specializa

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

2016-03-18 Thread Richard Smith via cfe-commits
rsmith added a subscriber: rsmith. rsmith added a comment. It seems useful to warn on this, but I'm concerned that there are valid code patterns that this will warn about where there is no reasonable way to rewrite the code that would suppress the warning. For instance: template class X {

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

2016-02-25 Thread Serge Pavlov via cfe-commits
Could someone provide a feedback? Thanks, --Serge 2016-01-26 20:55 GMT+06:00 Serge Pavlov : > 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: > >

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

2016-02-17 Thread Serge Pavlov via cfe-commits
Any feedback? Thanks, --Serge 2016-01-26 20:55 GMT+06:00 Serge Pavlov : > 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 class C