[libc-commits] [clang] [libc] [clang] Make __builtin_exp and __builtin_expf constexpr. (PR #199808)
Hubert Tong via libc-commits
libc-commits at lists.llvm.org
Fri Jun 19 12:57:20 PDT 2026
================
@@ -57,6 +57,12 @@ template <> struct Bounds<double> {
} // namespace exp_internal
template <typename T> LIBC_INLINE int exp_exceptions(T x, int rounding_mode) {
+ static_assert(FE_OVERFLOW != 0);
+ static_assert(FE_UNDERFLOW != 0);
+ static_assert(FE_INEXACT != 0);
+ static_assert(FE_INVALID != 0);
+ static_assert(FE_DIVBYZERO != 0);
+
----------------
hubert-reinterpretcast wrote:
What are these checks meant to do here? At least in user code, either the macros are defined (and necessarily non-zero to satisfy the C standard requirement that bitwise OR of all combinations of the defined macros result in distinct values) or they are not (and the assertion refers to an unresolved name).
https://github.com/llvm/llvm-project/pull/199808
More information about the libc-commits
mailing list