[PATCH] D37454: [coroutines] desugar auto type of await_resume before checking whether it is void or bool

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 4 17:49:24 PDT 2017


rsmith 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(),
----------------
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`.


https://reviews.llvm.org/D37454





More information about the cfe-commits mailing list