This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/71985] narrowing in initializer lists is not ill-formed where required


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]