sepavloff added a comment.
Initial commit (r305379) was reverted (r305381) because it broke self builds.
The reason was not related to the WillHaveBody flag but was due to the change:
if (isFriend) {
Function->setObjectOfFriendDecl();
if (FunctionTemplate)
sepavloff added a comment.
Thank you!
Committed as is, improvements will be made as separate patches.
Repository:
rL LLVM
https://reviews.llvm.org/D30375
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
This revision was automatically updated to reflect the committed changes.
Closed by commit rL305379: Function with unparsed body is a definition
(authored by sepavloff).
Changed prior to commit:
https://reviews.llvm.org/D30375?vs=101993=102512#toc
Repository:
rL LLVM
rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.
LGTM as-is, but a couple of questions for possible further improvements.
Comment at: lib/Sema/SemaDecl.cpp:12221
FD->setBody(Body);
+FD->setWillHaveBody(false);
sepavloff updated this revision to Diff 101993.
sepavloff added a comment.
Changed implementation
https://reviews.llvm.org/D30375
Files:
include/clang/AST/Decl.h
lib/Sema/SemaCUDA.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
sepavloff added a comment.
Thank you for explanation. Probably making new semantic action is an overkill.
The intent was to postpone setting flag `WillHaveBody` as late as possible, to
the moment when it becomes clear that the function indeed will have a body.
Otherwise parsing of deleted
rsmith added a comment.
If you want to take this path, you should also add `ActOnStartOfFunctionBody`
calls to the other parts of the parser that parse function definitions:
`Parser::ParseLateTemplatedFuncDef`, `Parser::ParseLexedObjCMethodDefs`, and
`Parser::ParseLexedMethodDefs`. You should
sepavloff updated this revision to Diff 101517.
sepavloff added a comment.
Rebased patch
https://reviews.llvm.org/D30375
Files:
include/clang/AST/Decl.h
include/clang/Sema/Sema.h
lib/Parse/Parser.cpp
lib/Sema/SemaCUDA.cpp
lib/Sema/SemaDecl.cpp
jlebar added a comment.
This doesn't look wrong to me, but I feel utterly unqualified to review this.
https://reviews.llvm.org/D30375
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
sepavloff created this revision.
While a function body is being parsed, the function declaration is not
considered
as a definition because it does not have a body yet. In some cases it leads to
incorrect interpretation, the case is presented in
https://bugs.llvm.org/show_bug.cgi?id=14785:
10 matches
Mail list logo