[Bug c++/92856] incorrectly accepts invalid C++11 braced initialisation of double from long double
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Dec 8 23:28:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92856
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #1)
> The behaviour is by design
And documented, see
https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#index-Wnarrowing
"For C++11 and later standards, narrowing conversions are diagnosed by default,
as required by the standard. A narrowing conversion from a constant produces an
error, and a narrowing conversion from a non-constant produces a warning, but
-Wno-narrowing suppresses the diagnostic. Note that this does not affect the
meaning of well-formed code; narrowing conversions are still considered
ill-formed in SFINAE contexts."
More information about the Gcc-bugs
mailing list