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

2016-10-03 Thread Serge Pavlov via cfe-commits
Ping. Thanks, --Serge 2016-09-16 23:17 GMT+07:00 Serge Pavlov : > Ping. > > Thanks, > --Serge > > 2016-09-08 20:43 GMT+07:00 Serge Pavlov : > >> Any feedback? >> >> Thanks, >> --Serge >> >> 2016-09-02 13:11 GMT+07:00 Serge Pavlov : >> >>> sepavloff updated this revision to Diff 70134. >>> sepavl

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

2016-09-16 Thread Serge Pavlov via cfe-commits
Ping. Thanks, --Serge 2016-09-08 20:43 GMT+07:00 Serge Pavlov : > Any feedback? > > Thanks, > --Serge > > 2016-09-02 13:11 GMT+07:00 Serge Pavlov : > >> sepavloff updated this revision to Diff 70134. >> sepavloff marked an inline comment as done. >> sepavloff added a comment. >> >> Updated patch

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

2016-09-08 Thread Serge Pavlov via cfe-commits
Any feedback? Thanks, --Serge 2016-09-02 13:11 GMT+07:00 Serge Pavlov : > sepavloff updated this revision to Diff 70134. > sepavloff marked an inline comment as done. > sepavloff added a comment. > > Updated patch > > Rewrite the condition in shouldLinkDependentDeclWithPrevious in more > compact

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

2016-09-01 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 70134. sepavloff marked an inline comment as done. sepavloff added a comment. Updated patch Rewrite the condition in shouldLinkDependentDeclWithPrevious in more compact form. https://reviews.llvm.org/D16989 Files: include/clang/Sema/Sema.h lib/Sema/

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

2016-09-01 Thread Serge Pavlov via cfe-commits
sepavloff marked an inline comment as done. Comment at: lib/Sema/SemaDecl.cpp:8652 @@ +8651,3 @@ +/// +bool Sema::shouldLinkDependentDeclWithPrevious(Decl *D, Decl *PrevDecl) { + DeclContext *LexicalDC = D->getLexicalDeclContext(); rsmith wrote: > Most of the log

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

2016-09-01 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/Sema/SemaDecl.cpp:8652 @@ +8651,3 @@ +/// +bool Sema::shouldLinkDependentDeclWithPrevious(Decl *D, Decl *PrevDecl) { + DeclContext *LexicalDC = D->getLexicalDeclContext(); Most of the logic in this function can be rep

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

2016-09-01 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 70025. sepavloff added a comment. Fixed DR136 for template classes Previously clang created declarations of friend functions declared in template classes even if that class was not instantiated. It allowed to make check for default arguments required by D

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

2016-08-29 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 69597. sepavloff added a comment. Added missed test case. https://reviews.llvm.org/D16989 Files: include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp test/SemaCXX/PR25848.cpp test/SemaCXX/friend2.cpp test/SemaCXX/function-redecl-2.cpp Index: test/Se

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

2016-08-29 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 69595. sepavloff added a comment. Updated patch Added missing checks for forward declarations in `shouldLinkDependentDeclWithPrevious`. Added test case from an ancient bug report. https://reviews.llvm.org/D16989 Files: include/clang/Sema/Sema.h lib/

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

2016-08-29 Thread Serge Pavlov via cfe-commits
sepavloff marked an inline comment as done. Comment at: lib/Sema/SemaDecl.cpp:8657-8658 @@ +8656,4 @@ + DeclContext *SemanticDC = D->getDeclContext(); + if (SemanticDC->isDependentContext()) +return false; + // Get here only for out-of-line declarations: lexical context is

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

2016-08-23 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/Sema/SemaDecl.cpp:8657-8658 @@ +8656,4 @@ + DeclContext *SemanticDC = D->getDeclContext(); + if (SemanticDC->isDependentContext()) +return false; + // Get here only for out-of-line declarations: lexical context is dependent, ---

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

2016-08-23 Thread Serge Pavlov via cfe-commits
Any feedback? Thanks, --Serge 2016-08-18 0:08 GMT+07:00 Serge Pavlov : > sepavloff updated this revision to Diff 68376. > sepavloff added a comment. > > Rebased the patch > > > https://reviews.llvm.org/D16989 > > Files: > include/clang/Sema/Sema.h > lib/Sema/SemaDecl.cpp > test/SemaCXX/PR2

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

2016-08-17 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 68376. sepavloff added a comment. Rebased the patch https://reviews.llvm.org/D16989 Files: include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp test/SemaCXX/PR25848.cpp test/SemaCXX/friend2.cpp Index: test/SemaCXX/friend2.cpp =

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

2016-07-25 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 65376. sepavloff added a comment. Added one more case in shouldLinkDependentDeclWithPrevious https://reviews.llvm.org/D16989 Files: include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp test/SemaCXX/PR25848.cpp test/SemaCXX/friend2.cpp Index: test/Sema

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

2016-07-18 Thread Serge Pavlov via cfe-commits
Any feedback? Thanks, --Serge 2016-06-20 1:52 GMT+06:00 Serge Pavlov : > sepavloff updated this revision to Diff 61220. > sepavloff added a comment. > > Updated patch > > Added handling of FunctionTemplateDecl to > shouldLinkDependentDeclWithPrevious. It is not > used now but is required for sub

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

2016-06-19 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 61220. sepavloff added a comment. Updated patch Added handling of FunctionTemplateDecl to shouldLinkDependentDeclWithPrevious. It is not used now but is required for subsequent patch. Also position comment correctly. http://reviews.llvm.org/D16989 Files

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

2016-06-03 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 59532. sepavloff added a comment. Fixed test for friend functions. http://reviews.llvm.org/D16989 Files: include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp test/SemaCXX/PR25848.cpp test/SemaCXX/friend2.cpp Index: test/SemaCXX/friend2.cpp ===

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

2016-05-30 Thread Serge Pavlov via cfe-commits
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 void f(); > template struct A { > template void f() {

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

2016-05-30 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 58983. sepavloff added a comment. Updated patch http://reviews.llvm.org/D16989 Files: include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp test/SemaCXX/PR25848.cpp test/SemaCXX/friend2.cpp Index: test/SemaCXX/friend2.cpp ==

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

2016-05-17 Thread Richard Smith via cfe-commits
rsmith added a comment. Please also add some testcases for the corresponding case for a friend function template: template void f(); template struct A { template void f() {} }; template struct B { template void f() {} }; A a; B b; // ill-formed Comment at

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

2016-05-16 Thread Serge Pavlov via cfe-commits
Any feedback? Thanks, --Serge 2016-05-03 22:40 GMT+06:00 Serge Pavlov : > 2016-04-26 0:55 GMT+06:00 Richard Smith : > >> rsmith added inline comments. >> >> >> Comment at: lib/Sema/SemaDecl.cpp:8611-8612 >> @@ -8609,3 +8610,4 @@ >> } else { >> - // This needs to happen

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

2016-05-03 Thread Serge Pavlov via cfe-commits
2016-04-26 0:55 GMT+06:00 Richard Smith : > rsmith added inline comments. > > > Comment at: lib/Sema/SemaDecl.cpp:8611-8612 > @@ -8609,3 +8610,4 @@ > } else { > - // This needs to happen first so that 'inline' propagates. > - NewFD->setPreviousDeclaration(cast(OldDe

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

2016-05-03 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 56015. sepavloff added a comment. Updated patch. http://reviews.llvm.org/D16989 Files: include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp test/SemaCXX/PR25848.cpp test/SemaCXX/friend2.cpp Index: test/SemaCXX/friend2.cpp =

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

2016-04-25 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/Sema/SemaDecl.cpp:8611-8612 @@ -8609,3 +8610,4 @@ } else { - // This needs to happen first so that 'inline' propagates. - NewFD->setPreviousDeclaration(cast(OldDecl)); + if (NewFD->isOutOfLine() && + NewFD-

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

2016-04-20 Thread Serge Pavlov via cfe-commits
2016-03-29 1:08 GMT+06:00 Serge Pavlov : > 2016-03-18 20:50 GMT+06:00 Richard Smith : > >> rsmith added a comment. >> >> Can we instead not add the function to the redeclaration chain until it's >> instantiated (like we do if it's dependent)? >> >> > I prepared implementation that uses this approa

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

2016-03-28 Thread Serge Pavlov via cfe-commits
2016-03-18 20:50 GMT+06:00 Richard Smith : > rsmith added a comment. > > Can we instead not add the function to the redeclaration chain until it's > instantiated (like we do if it's dependent)? > > I prepared implementation that uses this approach. In this variant information about potential defin

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

2016-03-28 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 51817. sepavloff added a comment. Changed implementation This implementation uses another approach. Previous version of the patch put friend functions into redeclaration chains but modified search algorithm so that it skipped such functions. In this versi

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

2016-03-19 Thread Richard Smith via cfe-commits
rsmith added a comment. Can we instead not add the function to the redeclaration chain until it's instantiated (like we do if it's dependent)? http://reviews.llvm.org/D16989 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.

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

2016-03-18 Thread Serge Pavlov via cfe-commits
sepavloff added a comment. Topic of friend function instantiation in C++ Standard discussion group