[Bug c++/69864] Narrowing conversion warning instead of an error

2016-02-19 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69864 --- Comment #7 from Jonathan Wakely --- (In reply to Manuel López-Ibáñez from comment #4) > (In reply to Jakub Jelinek from comment #3) > > Or use -pedantic-errors. > > I find it a bit ironic that Clang does inform the user when something is > a

[Bug c++/69864] Narrowing conversion warning instead of an error

2016-02-19 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69864 --- Comment #6 from Jonathan Wakely --- Because int b{2.3} absolutely definitely loses precision, and since it's a constant you can just fix the code. For {u} the compiler doesn't know whether it really narrows or not, since it depends on un tim

[Bug c++/69864] Narrowing conversion warning instead of an error

2016-02-19 Thread mgsergio at yandex dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69864 --- Comment #5 from mgsergio --- And what about the inconsistency with compilation error on int main() { int b{2.3}; } In that case an error is generated. And if I use template inline T narrowing_check(U const u) { return {u}; } I get a

[Bug c++/69864] Narrowing conversion warning instead of an error

2016-02-18 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69864 Manuel López-Ibáñez changed: What|Removed |Added CC||manu at gcc dot gnu.org Re

[Bug c++/69864] Narrowing conversion warning instead of an error

2016-02-18 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69864 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #3

[Bug c++/69864] Narrowing conversion warning instead of an error

2016-02-18 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69864 Markus Trippelsdorf changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC|

[Bug c++/69864] Narrowing conversion warning instead of an error

2016-02-18 Thread mgsergio at yandex dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69864 --- Comment #1 from mgsergio --- *gcc emits a warning on narrowing_check although an error should be generated instead.