[clang] c686dfd - Unconfuse gcc5.3 after 2e204e23911b1f / D87528
Nico Weber via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 26 09:56:31 PDT 2020
Author: Nico Weber
Date: 2020-10-26T12:55:38-04:00
New Revision: c686dfd61705f33419875b22eb08bd197a72cd18
URL: https://github.com/llvm/llvm-project/commit/c686dfd61705f33419875b22eb08bd197a72cd18
DIFF: https://github.com/llvm/llvm-project/commit/c686dfd61705f33419875b22eb08bd197a72cd18.diff
LOG: Unconfuse gcc5.3 after 2e204e23911b1f / D87528
The local variable CmpResult added in that change shadowed the
type CmpResult, which confused an older gcc. Rename the variable
CmpResult to APFloatCmpResult.
Added:
Modified:
clang/lib/AST/ExprConstant.cpp
Removed:
################################################################################
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index b8891055ab61..fa4026b865fb 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -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:
More information about the cfe-commits
mailing list