public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98202] New: C++ cannot parse F128 suffix for float128 literals
@ 2020-12-08 15:02 redi at gcc dot gnu.org
2022-02-24 0:31 ` [Bug c++/98202] " pinskia at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2020-12-08 15:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98202
Bug ID: 98202
Summary: C++ cannot parse F128 suffix for float128 literals
Product: gcc
Version: 10.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
auto f = __FLT128_MIN__;
<stdin>:1:10: error: unable to find numeric literal operator ‘operator""F128’
The macros for the F128 constants all end in a F128 suffix, which the C++
compiler doesn't understand.
Either the macros shouldn't be defined for C++ or (preferably) they should work
correctly. This would allow libstdc++ to define std::numeric_limits<__ieee128>
for powerpc64le.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/98202] C++ cannot parse F128 suffix for float128 literals
2020-12-08 15:02 [Bug c++/98202] New: C++ cannot parse F128 suffix for float128 literals redi at gcc dot gnu.org
@ 2022-02-24 0:31 ` pinskia at gcc dot gnu.org
2022-02-24 9:38 ` redi at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-24 0:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98202
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=87274
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Isn't this a dup of bug 87274 ?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/98202] C++ cannot parse F128 suffix for float128 literals
2020-12-08 15:02 [Bug c++/98202] New: C++ cannot parse F128 suffix for float128 literals redi at gcc dot gnu.org
2022-02-24 0:31 ` [Bug c++/98202] " pinskia at gcc dot gnu.org
@ 2022-02-24 9:38 ` redi at gcc dot gnu.org
2023-05-16 19:04 ` redi at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2022-02-24 9:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98202
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |DUPLICATE
Status|UNCONFIRMED |RESOLVED
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I suppose we can combine them.
This one is about the internal macros, which do not require -std=gnu++NN modes,
and they fail to compile even if you use a gnu++NN mode. The other bug only
fails for strict c++NN modes.
*** This bug has been marked as a duplicate of bug 87274 ***
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/98202] C++ cannot parse F128 suffix for float128 literals
2020-12-08 15:02 [Bug c++/98202] New: C++ cannot parse F128 suffix for float128 literals redi at gcc dot gnu.org
2022-02-24 0:31 ` [Bug c++/98202] " pinskia at gcc dot gnu.org
2022-02-24 9:38 ` redi at gcc dot gnu.org
@ 2023-05-16 19:04 ` redi at gcc dot gnu.org
2023-05-16 19:47 ` jakub at gcc dot gnu.org
2023-05-17 13:44 ` redi at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2023-05-16 19:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98202
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
With GCC 13 it's now a pedwarn:
f128.cc:1:1: warning: 'f128' or 'F128' suffix on floating constant only
available with '-std=c++2b' or '-std=gnu++2b' [-Wpedantic]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/98202] C++ cannot parse F128 suffix for float128 literals
2020-12-08 15:02 [Bug c++/98202] New: C++ cannot parse F128 suffix for float128 literals redi at gcc dot gnu.org
` (2 preceding siblings ...)
2023-05-16 19:04 ` redi at gcc dot gnu.org
@ 2023-05-16 19:47 ` jakub at gcc dot gnu.org
2023-05-17 13:44 ` redi at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-16 19:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98202
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Other option would be just hardcode those 4 constants by hand:
#define __FLT128_MAX__ 1.18973149535723176508575932662800702e+4932F128
#define __FLT128_NORM_MAX__ 1.18973149535723176508575932662800702e+4932F128
#define __FLT128_MIN__ 3.36210314311209350626267781732175260e-4932F128
#define __FLT128_EPSILON__ 1.92592994438723585305597794258492732e-34F128
#define __FLT128_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966F128
with __extension__ before it and Q suffix instead of F128. For __float128
I think those constants aren't going to change.
Advantage of doing that would be that even various versions of clang++ support
that,
while F128 suffix isn't supported.
So, use:
(__extension__ 0x1.ffffffffffffffffffffffffffffp+16383Q)
(__extension__ 0x1.ffffffffffffffffffffffffffffp+16383Q)
(__extension__ 0x1.0000000000000000000000000000p-16382Q)
(__extension__ 0x1.0000000000000000000000000000p-112Q)
(__extension__ 0x0.0000000000000000000000000001p-16382Q)
instead of those 4 constants.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/98202] C++ cannot parse F128 suffix for float128 literals
2020-12-08 15:02 [Bug c++/98202] New: C++ cannot parse F128 suffix for float128 literals redi at gcc dot gnu.org
` (3 preceding siblings ...)
2023-05-16 19:47 ` jakub at gcc dot gnu.org
@ 2023-05-17 13:44 ` redi at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2023-05-17 13:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98202
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Q can't be used with -std=c++NN strict modes, as noted in bug 87274
limits:2085: error: unable to find numeric literal operator 'operator""Q'
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-05-17 13:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-08 15:02 [Bug c++/98202] New: C++ cannot parse F128 suffix for float128 literals redi at gcc dot gnu.org
2022-02-24 0:31 ` [Bug c++/98202] " pinskia at gcc dot gnu.org
2022-02-24 9:38 ` redi at gcc dot gnu.org
2023-05-16 19:04 ` redi at gcc dot gnu.org
2023-05-16 19:47 ` jakub at gcc dot gnu.org
2023-05-17 13:44 ` 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).