public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94590] New: Incorrectly accepts invalid C++11 braced initialisation of double from long double if sizeof(long double)==sizeof(double)
@ 2020-04-14  8:59 dangelog at gmail dot com
  2020-04-14 10:15 ` [Bug c++/94590] " redi at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: dangelog at gmail dot com @ 2020-04-14  8:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94590
           Summary: Incorrectly accepts invalid C++11 braced
                    initialisation of double from long double if
                    sizeof(long double)==sizeof(double)
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dangelog at gmail dot com
                CC: dangelog at gmail dot com, marc at kdab dot com,
                    unassigned at gcc dot gnu.org
  Target Milestone: ---

+++ This bug was initially created as a clone of Bug #92856 +++

(Sorry, couldn't find a way to reopen _that_ bug, so creating a new one)


Hi,

When using list-initialization from a long double to double, GCC warns (and
rejects the code in SFINAE contexts) only on platforms where sizeof(long
double) > sizeof(double). This is OK, and documented.


However: on platforms where long double is the same as double, GCC incorrectly
accepts the code without emitting warnings, and affecting SFINAE.

For instance

* On ARM: https://godbolt.org/z/SRg3fr
* On X86-64 also passing -mlong-double-64: https://godbolt.org/z/GnRkHC

SFINAE contexts are affected as well: https://godbolt.org/z/icMA3k

Clang, MSVC reject the code.

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

end of thread, other threads:[~2020-05-07 23:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-14  8:59 [Bug c++/94590] New: Incorrectly accepts invalid C++11 braced initialisation of double from long double if sizeof(long double)==sizeof(double) dangelog at gmail dot com
2020-04-14 10:15 ` [Bug c++/94590] " redi at gcc dot gnu.org
2020-04-15  8:42 ` dangelog at gmail dot com
2020-04-19 17:05 ` mpolacek at gcc dot gnu.org
2020-04-19 17:32 ` mpolacek at gcc dot gnu.org
2020-04-20 19:40 ` mpolacek at gcc dot gnu.org
2020-05-07 18:16 ` cvs-commit at gcc dot gnu.org
2020-05-07 18:18 ` mpolacek at gcc dot gnu.org
2020-05-07 23:35 ` dangelog at gmail dot com

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