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
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
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
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
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
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
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
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
=
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
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();
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
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/
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
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
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
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
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
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.
18 matches
Mail list logo