[PATCH] D37454: [coroutines] Make sure auto return type of await_resume is properly handled
Gor Nishanov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 4 20:57:54 PDT 2017
GorNishanov marked an inline comment as done.
GorNishanov added inline comments.
================
Comment at: lib/Sema/SemaCoroutine.cpp:451
if (RetType->isReferenceType() ||
(AdjRetType != S.Context.BoolTy && AdjRetType != S.Context.VoidTy)) {
S.Diag(AwaitSuspend->getCalleeDecl()->getLocation(),
----------------
rsmith wrote:
> Don't desugar the type; instead, use `AdjRetType->isBooleanType() || AdjRetType->isVoidType()` here. You can also delete the `getUnqualifiedType()` call above if you do this, and just use `RetType` here, since `->isBooleanType()` on `const bool` returns `true`.
Cool! Much shorter and prettier. Thank you!
https://reviews.llvm.org/D37454
More information about the cfe-commits
mailing list