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: "nico at josuttis dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 24 Jul 2016 13:23:57 +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 #2 from Nicolai Josuttis <nico at josuttis dot de> ---
Sorry, but IMO this is NOT the same.
> float f[3] = { d, d, d };
is an initialization of an array,
which is already supported by C.
> std::vector<int> v1 { d };
is nothing that was possible before C++11.
Also both clang and VC++ handle this as a bug.
I am also surprised that ill-formed programs are not considered as bugs in
general. I didn't know that.
I always thought that a warning helps in places where a program is valid,
but probably not correct or useful.
So, why do other ill-formed programs result in bugs instead of warnings?
Sorry again
(Jonathan recommended me to open this bug, so ...).