[Bug c++/108223] GCC rejects QNaN in __builtin_fmax constant expression
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108223 --- Comment #3 from Nikolas Klauser --- It doesn't have to work, but it works for some inputs, so I would expect that it works for all. https://godbolt.org/z/KsrjEP77c
[Bug c++/108223] GCC rejects QNaN in __builtin_fmax constant expression
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108223 --- Comment #2 from Andrew Pinski --- That being said this works: #include constexpr bool test() { auto val = std::max(__builtin_nan(""), __builtin_nan("")); return true; } static_assert(test());