[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

Hubert Tong via cfe-commits cfe-commits at lists.llvm.org
Thu May 9 15:22:25 PDT 2024


================
@@ -14572,6 +14572,9 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) {
     int FrexpExp;
     llvm::RoundingMode RM = getActiveRoundingMode(Info, E);
     Result = llvm::frexp(Result, FrexpExp, RM);
+    if (!Result.isZero() && !Result.isNaN() && !Result.isInfinity())
+      assert(llvm::APFloat::isInRange(Result) &&
+            "The value is not in the expected range for frexp.");
----------------
hubert-reinterpretcast wrote:

assert((Result.isZero() || Result.isNaN() || Result.isInfinity() || ...) && "...");



https://github.com/llvm/llvm-project/pull/88978


More information about the cfe-commits mailing list