r304444 - Remove late nullptr pointer test (PR32447)

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 1 11:13:02 PDT 2017


Author: rksimon
Date: Thu Jun  1 13:13:02 2017
New Revision: 304444

URL: http://llvm.org/viewvc/llvm-project?rev=304444&view=rev
Log:
Remove late nullptr pointer test (PR32447)

IgnoreNarrowingConversion should never return nullptr, but I've added an assert just in case.

Modified:
    cfe/trunk/lib/Sema/SemaOverload.cpp

Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=304444&r1=304443&r2=304444&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Thu Jun  1 13:13:02 2017
@@ -330,13 +330,13 @@ StandardConversionSequence::getNarrowing
     } 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(),




More information about the cfe-commits mailing list