================ @@ -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()) { ---------------- hubert-reinterpretcast wrote:
I do not think there is any particular reason why this change is C++23 specific. The question remains whether the change should be made at all. If the primary rationale here is to facilitate testing using the Windows header definitions, I suspect the answer is that the Windows definition of NaN is not a C++ constant expression. @jcranmer-intel's comment (https://github.com/llvm/llvm-project/pull/88978/files#discussion_r1576817678), supports the interpretation that operations that result in NaN from non-qNaN inputs are not valid in a constant expression. Other than wanting to use the Windows header definitions for the tests here, is there a reason why this change belongs in this PR? 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