diff --git a/flang/lib/evaluate/fold.cc b/flang/lib/evaluate/fold.cc index 13f7a59877d0..2278195490b9 100644 --- a/flang/lib/evaluate/fold.cc +++ b/flang/lib/evaluate/fold.cc @@ -545,30 +545,6 @@ Expr FoldOperation(FoldingContext &context, FunctionRef &&funcRef) { return Expr{std::move(funcRef)}; } -// TODO pmk rm -template -Expr SIGN( - FoldingContext &context, const Scalar &to, const Scalar &from) { - bool isNegative{false}; - if constexpr (FROM::category == TypeCategory::Integer) { - isNegative = from.IsNegative(); - } else { - static_assert(FROM::category == TypeCategory::Real); - isNegative = from.IsSignBitSet(); - } - if constexpr (TO::category == TypeCategory::Integer) { - auto result{to.SIGN(isNegative)}; - if (result.overflow) { - context.messages().Say( - "SIGN() folding overflows integer(kind=%d)"_en_US, TO::kind); - } - return Expr{Constant{std::move(result.value)}}; - } else { - static_assert(TO::category == TypeCategory::Real); - return Expr{Constant{to.SIGN(isNegative)}}; - } -} - template Expr> FoldIntrinsicFunction( FoldingContext &context,