================
@@ -2922,7 +2922,7 @@ static bool handleFloatFloatBinOp(EvalInfo &Info, const 
BinaryOperator *E,
   //   If during the evaluation of an expression, the result is not
   //   mathematically defined [...], the behavior is undefined.
   // FIXME: C++ rules require us to not conform to IEEE 754 here.
-  if (LHS.isNaN()) {
+  if (!Info.getLangOpts().CPlusPlus23 && LHS.isNaN()) {
----------------
cor3ntin wrote:

This is a C function the semantics should reasonably be that of C
https://eel.is/c++draft/c.math#cmath.syn-1

fmin is well defined for Nan https://en.cppreference.com/w/c/numeric/math/fmin
frexp is well defined for NaN 
https://en.cppreference.com/w/cpp/numeric/math/frexp
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf


https://github.com/llvm/llvm-project/pull/88978
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to