[Bug libstdc++/105281] status of constexpr <cmath> and <cstdlib> for c++23

de34 at live dot cn gcc-bugzilla@gcc.gnu.org
Tue Apr 19 09:57:23 GMT 2022


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

Jiang An <de34 at live dot cn> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |de34 at live dot cn

--- Comment #2 from Jiang An <de34 at live dot cn> ---
A quick glance at c_global/cmath:

constexpr in libstdc++, non-constexpr in C++23:
Transcendental and non-rational function families, constexpr potentially
results in ODR-violation (Bug 102916):
exp
expm1
exp2
sin
cos
tan
sinh
cosh
tanh
log
log1p
log10
log2
asin
acos
atan
atan2
asinh
acosh
atanh
pow
sqrt
hypot (except for 3-argument overloads)
cbrt
tgamma
lgamma
erf
erfc

Functions that "depend strongly on rounding mode":
nearbyint
rint
lrint
llrint

constexpr in C++23, lack constexpr (for some overloads) in libstdc++:
abs
modf
remquo
frexp

Other functions made constexpr by P0533 seems suitably marked with constexpr in
libstdc++. I think lack of constexpr for modf, remquo, and frexp is because of
the C++11 constexpr rule (constexpr functions were required to be pure).


More information about the Gcc-bugs mailing list