<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 28 May 2017 at 12:53, Eric Fiselier via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">EricWF marked an inline comment as done.<br>
</span>EricWF added inline comments.<br>
<br>
<br>
================<br>
<span class="">Comment at: lib/Sema/SemaCoroutine.cpp:393<br>
+    //   - await-suspend is the expression e.await_suspend(h), which shall be<br>
+    //     a prvalue of type void or bool.<br>
+    QualType RetType = AwaitSuspend->getType();<br>
----------------<br>
</span><span class="">rsmith wrote:<br>
> It looks like you're not checking the 'prvalue' part of this.<br>
</span>I thought so too. I'll add tests to make sure it's being handled correctly.<br>
The following test should expose a lack of checking for `prvalues`, right?<br>
<br>
```<br>
template <class BoolTy><br>
struct TestAwait {<br>
  bool await_ready();<br>
  template <class F> BoolTy await_suspend(F); // expected-error<br>
  void await_resume();<br>
};<br>
void test() {<br>
  co_await TestAwait<bool&&>{};<br>
  co_await TestAwait<bool&>{};<br>
}<br>
```<br></blockquote><div><br></div><div>Yes. (I would also try some cv-qualified cases, with and without the reference, just for completeness.)</div></div></div></div>