[clang] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin and frexp. (PR #88978)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 23 09:27:54 PDT 2024
================
@@ -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
More information about the cfe-commits
mailing list