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

[Bug c++/69864] New: Narrowing conversion

2016-02-18 Thread mgsergio at yandex dot ru
: unassigned at gcc dot gnu.org Reporter: mgsergio at yandex dot ru Target Milestone: --- #include #include using namespace std; template inline T narrowing_check(U const u) { // Also gives only warning // T t{u}; // return t; return {u}; } int main() { auto a