From 2e2485c6cc9840e905872938960b8d8306648060 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 1 Jun 2017 18:13:02 +0000 Subject: [PATCH] Remove late nullptr pointer test (PR32447) IgnoreNarrowingConversion should never return nullptr, but I've added an assert just in case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304444 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaOverload.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 1ba84034fa..e0583d7164 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -330,13 +330,13 @@ StandardConversionSequence::getNarrowingKind(ASTContext &Ctx, } else if (FromType->isIntegralType(Ctx) && ToType->isRealFloatingType()) { llvm::APSInt IntConstantValue; const Expr *Initializer = IgnoreNarrowingConversion(Converted); + assert(Initializer && "Unknown conversion expression"); // If it's value-dependent, we can't tell whether it's narrowing. if (Initializer->isValueDependent()) return NK_Dependent_Narrowing; - if (Initializer && - Initializer->isIntegerConstantExpr(IntConstantValue, Ctx)) { + if (Initializer->isIntegerConstantExpr(IntConstantValue, Ctx)) { // Convert the integer to the floating type. llvm::APFloat Result(Ctx.getFloatTypeSemantics(ToType)); Result.convertFromAPInt(IntConstantValue, IntConstantValue.isSigned(), -- 2.40.0