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

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 13 20:23:48 PDT 2017


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 lvalue reference. @GorNishanov Can you take a look at this? Reproducer:

  struct AwaitResumeReturnsLValue {
    bool await_ready();
    void await_suspend(std::experimental::coroutine_handle<>);
    int& await_resume();
  };
  
  void AwaitReturnsLValue() {
    AwaitResumeReturnsLValue a;
    int& x = co_await a;
  }


https://reviews.llvm.org/D34021

Files:
  include/clang/Sema/Sema.h
  lib/Sema/SemaCoroutine.cpp
  lib/Sema/SemaStmt.cpp
  test/SemaCXX/co_await-range-for.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34021.102472.patch
Type: text/x-patch
Size: 14781 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170614/fdb71c4b/attachment-0001.bin>


More information about the cfe-commits mailing list