public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/96862] New: -frounding-math -std=c++2a error: '(1.29e+2 * 6.9314718055994529e-1)' is not a constant expression
@ 2020-08-31  9:41 Laurent.Rineau__gcc at normalesup dot org
  2020-08-31  9:52 ` [Bug libstdc++/96862] " jakub at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: Laurent.Rineau__gcc at normalesup dot org @ 2020-08-31  9:41 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96862
           Summary: -frounding-math -std=c++2a error: '(1.29e+2 *
                    6.9314718055994529e-1)' is not a constant expression
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Laurent.Rineau__gcc at normalesup dot org
  Target Milestone: ---

Commit e6c76f0d3327bf00c96f5a63961c1d5ab77512db introduced a compilation error
with `-frounding-math -std=c++2a`: it seems that, with `-frounding-math` a
floating-point expression cannot be constexpr.


# cat test.cpp
#include <string>
# g++ --version
g++ (GCC) 11.0.0 20200828 (experimental)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# g++ -std=c++2a -frounding-math test.cpp
In file included from /usr/local/include/c++/11.0.0/bits/range_access.h:40,
                 from /usr/local/include/c++/11.0.0/string:54,
                 from test.cpp:1:
/usr/local/include/c++/11.0.0/bits/max_size_type.h:708:35: error: '(1.29e+2 *
6.9314718055994529e-1)' is not a constant expression
  708 |         = static_cast<int>(digits * numbers::ln2 / numbers::ln10);
      |                            ~~~~~~~^~~~~~~~~~~~~~
/usr/local/include/c++/11.0.0/bits/max_size_type.h:734:50: error:
'(8.8722839111672997e+1 / 2.3025850929940459e+0)' is not a constant expression
  734 |         = static_cast<int>(digits * numbers::ln2 / numbers::ln10);
      |                            ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~

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

end of thread, other threads:[~2022-12-25  7:19 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-31  9:41 [Bug libstdc++/96862] New: -frounding-math -std=c++2a error: '(1.29e+2 * 6.9314718055994529e-1)' is not a constant expression Laurent.Rineau__gcc at normalesup dot org
2020-08-31  9:52 ` [Bug libstdc++/96862] " jakub at gcc dot gnu.org
2020-08-31 10:57 ` redi at gcc dot gnu.org
2020-08-31 11:12 ` jakub at gcc dot gnu.org
2020-08-31 13:06 ` [Bug c++/96862] " rguenth at gcc dot gnu.org
2020-08-31 13:17 ` Laurent.Rineau__gcc at normalesup dot org
2020-08-31 13:40 ` glisse at gcc dot gnu.org
2020-08-31 13:57 ` redi at gcc dot gnu.org
2020-08-31 14:06 ` jakub at gcc dot gnu.org
2020-08-31 14:22 ` glisse at gcc dot gnu.org
2020-08-31 14:29 ` jakub at gcc dot gnu.org
2020-09-03 18:12 ` cvs-commit at gcc dot gnu.org
2020-09-11  7:47 ` cvs-commit at gcc dot gnu.org
2020-09-16 19:23 ` cvs-commit at gcc dot gnu.org
2021-07-27  5:34 ` pinskia at gcc dot gnu.org
2021-08-22  0:43 ` pinskia at gcc dot gnu.org
2021-10-27 13:11 ` rguenth at gcc dot gnu.org
2021-10-27 13:43 ` jakub at gcc dot gnu.org
2022-12-25  7:19 ` pinskia 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).