From: Eric Fiselier Date: Tue, 18 Apr 2017 05:30:39 +0000 (+0000) Subject: Assert that a valid operator new/delete signature is always found by the coroutine... X-Git-Tag: llvmorg-5.0.0-rc1~7480 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c512875ff603ee9bf5bcb6450e2da7a6c50f6368;p=platform%2Fupstream%2Fllvm.git Assert that a valid operator new/delete signature is always found by the coroutine body llvm-svn: 300529 --- diff --git a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp index 6d8f4fac01d8..c709a1a723d0 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(); 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;