https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109378

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Also you could do:
template <typename Type>
inline constexpr Type   my_sqrt(const Type x)   noexcept
{
    if (std::isless(x, 0.0)) __builtin_unreachable();
    return std::sqrt(x);
}

And GCC will optimize away the check for negative and NAN correctly on the
trunk.

Reply via email to