Re: [PATCH] D30170: Function definition may have uninstantiated body

2018-03-13 Thread Kim Gräsman via cfe-commits
On Wed, Feb 28, 2018 at 8:21 PM, Richard Smith - zygoloid via Phabricator via cfe-commits wrote: > > Comment at: lib/Sema/SemaDecl.cpp:11986 > + !FD->isDefined(Definition) > + && FD->getDeclContext()->isFileContext()) { > +// If this is a friend function defined in a

[PATCH] D30170: Function definition may have uninstantiated body

2018-02-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff marked 3 inline comments as done. sepavloff added a comment. Thank you! Comment at: lib/Sema/SemaDecl.cpp:11995-12006 +for (auto I : FD->redecls()) { + if (I != FD && !I->isInvalidDecl() && + I->getFriendObjectKind() != Decl::FOK_None) { +if

[PATCH] D30170: Function definition may have uninstantiated body

2018-02-28 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL326419: Function definition may have uninstantiated body (authored by sepavloff, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D30170?vs=1155

[PATCH] D30170: Function definition may have uninstantiated body

2018-02-28 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added inline comments. This revision is now accepted and ready to land. Comment at: include/clang/AST/Decl.h:1840 + /// there is one). + /// bool hasBody(const FunctionDecl *&Definition) const; Please remove trailing bla

[PATCH] D30170: Function definition may have uninstantiated body

2018-02-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. The issue is still observed in trunk. Other compilers process the tests correctly (checked using https://godbolt.org/). For instance, the code: template struct C20 { friend void func_20() {} // expected-note{{previous definition is here}} }; C20 c20i; void fu

[PATCH] D30170: Function definition may have uninstantiated body

2017-09-16 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 115534. sepavloff added a comment. Rebased patch. https://reviews.llvm.org/D30170 Files: include/clang/AST/Decl.h lib/Sema/SemaDecl.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp test/SemaCXX/friend2.cpp Index: test/SemaCXX/friend2.cpp

[PATCH] D30170: Function definition may have uninstantiated body

2017-07-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Ping. https://reviews.llvm.org/D30170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30170: Function definition may have uninstantiated body

2017-07-12 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 106192. sepavloff added a comment. Rebased patch https://reviews.llvm.org/D30170 Files: include/clang/AST/Decl.h lib/Sema/SemaDecl.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp test/SemaCXX/friend2.cpp Index: test/SemaCXX/friend2.cpp =

[PATCH] D30170: Function definition may have uninstantiated body

2017-06-04 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 101362. sepavloff added a comment. Updated patch according to review notes https://reviews.llvm.org/D30170 Files: include/clang/AST/Decl.h lib/Sema/SemaDecl.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp test/SemaCXX/friend2.cpp Index: test/SemaCXX

[PATCH] D30170: Function definition may have uninstantiated body

2017-06-02 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: include/clang/AST/Decl.h:1868-1871 bool isThisDeclarationADefinition() const { -return IsDeleted || Body || IsLateTemplateParsed; +return IsDeleted || IsDefaulted || Body || IsLateTemplateParsed || + hasDefiningAttr();

[PATCH] D30170: Function definition may have uninstantiated body

2017-06-02 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 101260. sepavloff added a comment. Do not call getCanonicalDecl for deleted functions https://reviews.llvm.org/D30170 Files: include/clang/AST/Decl.h lib/AST/Decl.cpp lib/Sema/SemaDecl.cpp test/SemaCXX/cxx0x-cursory-default-delete.cpp test/SemaC

[PATCH] D30170: Function definition may have uninstantiated body

2017-05-27 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 100534. sepavloff added a comment. Updated patch - Reduce number of added functions, - Fixed some comments, - Function `isOdrDefined` now checks uninstantiated bodies only for friend functions. https://reviews.llvm.org/D30170 Files: include/clang/AST/

[PATCH] D30170: Function definition may have uninstantiated body

2017-05-27 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff marked 2 inline comments as done. sepavloff added a comment. In https://reviews.llvm.org/D30170#761342, @rsmith wrote: > Do we really need two different notions of "definition" and "odr definition" > here? What goes wrong if we always treat the "instantiation of a friend > function de

[PATCH] D30170: Function definition may have uninstantiated body

2017-05-22 Thread Richard Smith via Phabricator via cfe-commits
rsmith added a comment. Do we really need two different notions of "definition" and "odr definition" here? What goes wrong if we always treat the "instantiation of a friend function definition" case as being a definition? Comment at: include/clang/AST/Decl.h:1789 + // fu

[PATCH] D30170: Function definition may have uninstantiated body

2017-05-21 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 99698. sepavloff added a comment. Made the patch a bit more compact. NFC. https://reviews.llvm.org/D30170 Files: include/clang/AST/Decl.h lib/AST/Decl.cpp lib/Sema/SemaDecl.cpp test/SemaCXX/cxx0x-cursory-default-delete.cpp test/SemaCXX/friend2.c

[PATCH] D30170: Function definition may have uninstantiated body

2017-03-20 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 92340. sepavloff added a comment. Small simplicifation https://reviews.llvm.org/D30170 Files: include/clang/AST/Decl.h lib/AST/Decl.cpp lib/Sema/SemaDecl.cpp test/SemaCXX/cxx0x-cursory-default-delete.cpp test/SemaCXX/friend2.cpp Index: test/Sem

[PATCH] D30170: Function definition may have uninstantiated body

2017-02-21 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 89206. sepavloff added a comment. Implement `isDefined` through `isThisDeclarationADefinition`. https://reviews.llvm.org/D30170 Files: include/clang/AST/Decl.h lib/AST/Decl.cpp lib/Sema/SemaDecl.cpp test/SemaCXX/cxx0x-cursory-default-delete.cpp

[PATCH] D30170: Function definition may have uninstantiated body

2017-02-20 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. Current implementation of `FunctionDecl::isDefined` does not take into account declarations that do not have a body, but it can be instantiated from a templated definition. This behavior creates problems when processing friend functions defined in class templates.