public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/105281] New: status of constexpr <cmath> and <cstdlib> for c++23
@ 2022-04-15  5:59 cooky.ykooc922 at gmail dot com
  2022-04-15 13:47 ` [Bug libstdc++/105281] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: cooky.ykooc922 at gmail dot com @ 2022-04-15  5:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105281
           Summary: status of constexpr <cmath> and <cstdlib> for c++23
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cooky.ykooc922 at gmail dot com
  Target Milestone: ---

some of <cmath> functions such as std::fpclassify are declared constexpr, but i
don't know the status of whether it has been fully implemented for c++23 in
which gcc version?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/105281] status of constexpr <cmath> and <cstdlib> for c++23
  2022-04-15  5:59 [Bug libstdc++/105281] New: status of constexpr <cmath> and <cstdlib> for c++23 cooky.ykooc922 at gmail dot com
@ 2022-04-15 13:47 ` redi at gcc dot gnu.org
  2022-04-19  9:57 ` de34 at live dot cn
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2022-04-15 13:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Those changes in <cmath> have been present since GCC 4.6, so they predate the
C++23 changes by *many* years. Nobody has yet verified how closely it conforms
to the new C++23 spec.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/105281] status of constexpr <cmath> and <cstdlib> for c++23
  2022-04-15  5:59 [Bug libstdc++/105281] New: status of constexpr <cmath> and <cstdlib> for c++23 cooky.ykooc922 at gmail dot com
  2022-04-15 13:47 ` [Bug libstdc++/105281] " redi at gcc dot gnu.org
@ 2022-04-19  9:57 ` de34 at live dot cn
  2022-11-30 13:00 ` redi at gcc dot gnu.org
  2023-05-22  9:08 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: de34 at live dot cn @ 2022-04-19  9:57 UTC (permalink / raw)
  To: gcc-bugs

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).

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/105281] status of constexpr <cmath> and <cstdlib> for c++23
  2022-04-15  5:59 [Bug libstdc++/105281] New: status of constexpr <cmath> and <cstdlib> for c++23 cooky.ykooc922 at gmail dot com
  2022-04-15 13:47 ` [Bug libstdc++/105281] " redi at gcc dot gnu.org
  2022-04-19  9:57 ` de34 at live dot cn
@ 2022-11-30 13:00 ` redi at gcc dot gnu.org
  2023-05-22  9:08 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2022-11-30 13:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Thanks for the survey!

(In reply to Jiang An from comment #2)
> constexpr in C++23, lack constexpr (for some overloads) in libstdc++:
> abs
> modf
> remquo
> frexp

Also imaxabs and imaxdiv, assuming https://cplusplus.github.io/LWG/issue3834
gets approved.

These are handled by the front-end though, so they work in constexpr anyway.
Even if we add constexpr to the additional overloads in <cmath>, it won't be
present on ::modf(double) which is declared in libc and added to namespace std
with a using-declaration.

The implicit constexpr added by the front-end only works if you use don't use
-fno-builtin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/105281] status of constexpr <cmath> and <cstdlib> for c++23
  2022-04-15  5:59 [Bug libstdc++/105281] New: status of constexpr <cmath> and <cstdlib> for c++23 cooky.ykooc922 at gmail dot com
                   ` (2 preceding siblings ...)
  2022-11-30 13:00 ` redi at gcc dot gnu.org
@ 2023-05-22  9:08 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2023-05-22  9:08 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |g.peterhoff@t-online.de

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
*** Bug 109928 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-22  9:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-15  5:59 [Bug libstdc++/105281] New: status of constexpr <cmath> and <cstdlib> for c++23 cooky.ykooc922 at gmail dot com
2022-04-15 13:47 ` [Bug libstdc++/105281] " redi at gcc dot gnu.org
2022-04-19  9:57 ` de34 at live dot cn
2022-11-30 13:00 ` redi at gcc dot gnu.org
2023-05-22  9:08 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).