summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCoroutine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaCoroutine.cpp')
-rw-r--r--clang/lib/Sema/SemaCoroutine.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp
index 6d8f4fac01d..c709a1a723d 100644
--- a/clang/lib/Sema/SemaCoroutine.cpp
+++ b/clang/lib/Sema/SemaCoroutine.cpp
@@ -912,7 +912,9 @@ bool CoroutineStmtBuilder::makeNewAndDeleteExpr() {
OperatorNew, UnusedResult);
}
- if (OperatorNew && RequiresNoThrowAlloc) {
+ assert(OperatorNew && "expected definition of operator new to be found");
+
+ if (RequiresNoThrowAlloc) {
const auto *FT = OperatorNew->getType()->getAs<FunctionProtoType>();
if (!FT->isNothrow(S.Context, /*ResultIfDependent*/ false)) {
S.Diag(OperatorNew->getLocation(),
@@ -924,9 +926,6 @@ bool CoroutineStmtBuilder::makeNewAndDeleteExpr() {
}
}
- // FIXME: Diagnose and handle the case where no matching operator new is found
- // (ie OperatorNew == nullptr)
-
if ((OperatorDelete = findDeleteForPromise(S, Loc, PromiseType)) == nullptr)
return false;
OpenPOWER on IntegriCloud