This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71985] narrowing in initializer lists is not ill-formed where required
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 24 Jul 2016 15:23:11 +0000
- Subject: [Bug c++/71985] narrowing in initializer lists is not ill-formed where required
- Auto-submitted: auto-generated
- References: <bug-71985-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71985
--- Comment #6 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Note also that we give two warnings:
prog.cc:7:15: error: narrowing conversion of '0.0' from 'double' to 'int'
inside { } [-Wnarrowing]
B b2 { 1, 0.0 };
^
prog.cc:9:25: warning: narrowing conversion of 'd' from 'double' to 'int'
inside { } [-Wnarrowing]
std::vector<int> v1 { d };
^
prog.cc:9:25: warning: narrowing conversion of 'd' from 'double' to 'int'
inside { } [-Wnarrowing]