On 28 May 2017 at 12:53, Eric Fiselier via Phabricator < revi...@reviews.llvm.org> wrote:
> EricWF marked an inline comment as done. > EricWF added inline comments. > > > ================ > Comment at: lib/Sema/SemaCoroutine.cpp:393 > + // - await-suspend is the expression e.await_suspend(h), which > shall be > + // a prvalue of type void or bool. > + QualType RetType = AwaitSuspend->getType(); > ---------------- > rsmith wrote: > > It looks like you're not checking the 'prvalue' part of this. > I thought so too. I'll add tests to make sure it's being handled correctly. > The following test should expose a lack of checking for `prvalues`, right? > > ``` > template <class BoolTy> > struct TestAwait { > bool await_ready(); > template <class F> BoolTy await_suspend(F); // expected-error > void await_resume(); > }; > void test() { > co_await TestAwait<bool&&>{}; > co_await TestAwait<bool&>{}; > } > ``` > Yes. (I would also try some cv-qualified cases, with and without the reference, just for completeness.)
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits