[PATCH] D34021: [coroutines] Fix co_await for range statement

2017-06-13 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF updated this revision to Diff 102472. EricWF added a comment. - Remove changes to how `CoroutineSuspendExpr`s `ExprValueType` is calculated. They were incorrect. However this means that Clang still fails to compile `co_await` and `co_yield` expressions where `await_resume` returns an lval

[PATCH] D34021: [coroutines] Fix co_await for range statement

2017-06-13 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF added inline comments. Comment at: include/clang/AST/ExprCXX.h:4136 + : Expr(SC, Resume->getType(), + (Resume->getType()->isLValueReferenceType() ? VK_LValue : + Resume->getType()->isRValueReferenceType() ? VK_XValue : @rsmith

[PATCH] D34021: [coroutines] Fix co_await for range statement

2017-06-12 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov accepted this revision. GorNishanov added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D34021 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/list

[PATCH] D34021: [coroutines] Fix co_await for range statement

2017-06-08 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF added inline comments. Comment at: test/SemaCXX/coawait_range_for.cpp:133 + +struct ForLoopAwaiterCoawaitLookup { + struct promise_type { This test is incorrect WRT ADL lookup. https://reviews.llvm.org/D34021

[PATCH] D34021: [coroutines] Fix co_await for range statement

2017-06-08 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF updated this revision to Diff 101862. EricWF added a comment. - Fix value category of `co_await`/`co_yield` expression. ie use the return type of the resume expression to determine the value category. @rsmith Should the `CoroutineSuspendExpr` constructor be using `getCallReturnType()` to

[PATCH] D34021: [coroutines] Fix co_await for range statement

2017-06-07 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF updated this revision to Diff 101858. https://reviews.llvm.org/D34021 Files: include/clang/Sema/Sema.h lib/Sema/SemaCoroutine.cpp lib/Sema/SemaStmt.cpp test/SemaCXX/coawait_range_for.cpp Index: test/SemaCXX/coawait_range_for.cpp

[PATCH] D34021: [coroutines] Fix co_await for range statement

2017-06-07 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF updated this revision to Diff 101857. EricWF added a comment. - More test cleanup. Sorry for the noise. https://reviews.llvm.org/D34021 Files: include/clang/Sema/Sema.h lib/Sema/SemaCoroutine.cpp lib/Sema/SemaStmt.cpp test/SemaCXX/coawait_range_for.cpp Index: test/SemaCXX/coawai

[PATCH] D34021: [coroutines] Fix co_await for range statement

2017-06-07 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF updated this revision to Diff 101854. EricWF added a comment. - Fix clang-format nonsense in tests. https://reviews.llvm.org/D34021 Files: include/clang/Sema/Sema.h lib/Sema/SemaCoroutine.cpp lib/Sema/SemaStmt.cpp test/SemaCXX/coawait_range_for.cpp Index: test/SemaCXX/coawait_ra

[PATCH] D34021: [coroutines] Fix co_await for range statement

2017-06-07 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF updated this revision to Diff 101853. EricWF added a comment. - Add FIXME comments for incorrect use of `getCurScope()` after initial parse. https://reviews.llvm.org/D34021 Files: include/clang/Sema/Sema.h lib/Sema/SemaCoroutine.cpp lib/Sema/SemaStmt.cpp test/SemaCXX/coawait_rang

[PATCH] D34021: [coroutines] Fix co_await for range statement

2017-06-07 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF created this revision. Currently we build the co_await expressions on the wrong implicit statements of the implicit ranged for; Specifically we build the co_await expression wrapping the range declaration, but it should wrap the begin expression. This patch fixes co_await on range for.