[PATCH] D30375: Function with unparsed body is a definition

2017-06-21 Thread Serge Pavlov via Phabricator via cfe-commits
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)

[PATCH] D30375: Function with unparsed body is a definition

2017-06-14 Thread Serge Pavlov via Phabricator via cfe-commits
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

[PATCH] D30375: Function with unparsed body is a definition

2017-06-14 Thread Serge Pavlov via Phabricator via cfe-commits
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

[PATCH] D30375: Function with unparsed body is a definition

2017-06-12 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
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);

[PATCH] D30375: Function with unparsed body is a definition

2017-06-08 Thread Serge Pavlov via Phabricator via cfe-commits
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

[PATCH] D30375: Function with unparsed body is a definition

2017-06-08 Thread Serge Pavlov via Phabricator via cfe-commits
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

[PATCH] D30375: Function with unparsed body is a definition

2017-06-06 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
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

[PATCH] D30375: Function with unparsed body is a definition

2017-06-06 Thread Serge Pavlov via Phabricator via cfe-commits
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

[PATCH] D30375: Function with unparsed body is a definition

2017-02-27 Thread Justin Lebar via Phabricator via cfe-commits
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

[PATCH] D30375: Function with unparsed body is a definition

2017-02-25 Thread Serge Pavlov via Phabricator via 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: