[PATCH] D33625: [coroutines] Diagnose invalid result types for `await_resume` and `await_suspend` and add missing conversions.
Richard Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun May 28 12:44:38 PDT 2017
rsmith added inline comments.
================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:8977-8980
+ "the return type of 'await_suspend' is required to be 'void' or 'bool' (have %0)"
+>;
+def note_await_ready_no_bool_conversion : Note<
+ "the return type of 'await_ready' is required to be contextually convertible to 'bool'"
----------------
I would drop the leading 'the' from both of these diagnostics for consistency with our normal terse sentence fragment style.
================
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();
----------------
It looks like you're not checking the 'prvalue' part of this.
https://reviews.llvm.org/D33625
More information about the cfe-commits
mailing list