Unconfuse gcc5.3 after 2e204e23911b1f / D87528
authorNico Weber <thakis@chromium.org>
Mon, 26 Oct 2020 16:55:33 +0000 (12:55 -0400)
committerNico Weber <thakis@chromium.org>
Mon, 26 Oct 2020 16:55:38 +0000 (12:55 -0400)
The local variable CmpResult added in that change shadowed the
type CmpResult, which confused an older gcc. Rename the variable
CmpResult to APFloatCmpResult.

clang/lib/AST/ExprConstant.cpp

index b889105..fa4026b 100644 (file)
@@ -12561,16 +12561,16 @@ EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E,
       return false;
 
     assert(E->isComparisonOp() && "Invalid binary operator!");
-    llvm::APFloatBase::cmpResult CmpResult = LHS.compare(RHS);
+    llvm::APFloatBase::cmpResult APFloatCmpResult = LHS.compare(RHS);
     if (!Info.InConstantContext &&
-        CmpResult == APFloat::cmpUnordered &&
+        APFloatCmpResult == APFloat::cmpUnordered &&
         E->getFPFeaturesInEffect(Info.Ctx.getLangOpts()).isFPConstrained()) {
       // Note: Compares may raise invalid in some cases involving NaN or sNaN.
       Info.FFDiag(E, diag::note_constexpr_float_arithmetic_strict);
       return false;
     }
     auto GetCmpRes = [&]() {
-      switch (CmpResult) {
+      switch (APFloatCmpResult) {
       case APFloat::cmpEqual:
         return CmpResult::Equal;
       case APFloat::cmpLessThan: