diff --git a/flang/lib/Evaluate/fold-logical.cpp b/flang/lib/Evaluate/fold-logical.cpp index 4c1afe9a0f2952..b7d641711c363d 100644 --- a/flang/lib/Evaluate/fold-logical.cpp +++ b/flang/lib/Evaluate/fold-logical.cpp @@ -482,11 +482,9 @@ static Expr> RewriteOutOfRange( CHECK(x != nullptr); if (const auto *mold{UnwrapExpr>(args[1])}) { DynamicType xType{x->GetType().value()}; - DynamicType moldType{mold->GetType().value()}; std::optional> result; bool alwaysFalse{false}; if (auto *iXExpr{UnwrapExpr>(*x)}) { - DynamicType iXType{iXExpr->GetType().value()}; int iXKind{iXExpr->GetType().value().kind()}; if (auto *iMoldExpr{UnwrapExpr>(*mold)}) { // INTEGER -> INTEGER @@ -522,7 +520,6 @@ static Expr> RewriteOutOfRange( } } } else if (auto *rXExpr{UnwrapExpr>(*x)}) { - DynamicType rXType{rXExpr->GetType().value()}; int rXKind{rXExpr->GetType().value().kind()}; if (auto *iMoldExpr{UnwrapExpr>(*mold)}) { // REAL -> INTEGER