[Bug c++/93589] Template instantiation creates a conversion warning when it should not

2020-03-18 Thread jrdowning at yahoo dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93589 John Downing changed: What|Removed |Added CC||jrdowning at yahoo dot com --- Comment

[Bug c++/93589] Template instantiation creates a conversion warning when it should not

2020-02-24 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93589 --- Comment #10 from Jonathan Wakely --- No, you've misunderstood. It doesn't mean "can, if the compiler chooses to". There is no design decision involved. Types smaller than int *can* be promoted to int, and in certain contexts they *are*

[Bug c++/93589] Template instantiation creates a conversion warning when it should not

2020-02-20 Thread jrdowning at yahoo dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93589 --- Comment #9 from John Downing --- (In reply to Jason Merrill from comment #7) > Rather, it was suppressed for the simple case where the RHS has a suitable > type. As Jonathan says, (CHAR_BIT * static_cast(i)) has type int (it > would be

[Bug c++/93589] Template instantiation creates a conversion warning when it should not

2020-02-20 Thread jrdowning at yahoo dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93589 --- Comment #8 from John Downing --- > (In reply to John Downing from comment #5) > > This will generate a warning, for the char and short cases, when the "|=" > > happens. This is despite "val" being explicitly declared as a char or an > >

[Bug c++/93589] Template instantiation creates a conversion warning when it should not

2020-02-15 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93589 Jason Merrill changed: What|Removed |Added CC||jason at gcc dot gnu.org --- Comment #7

[Bug c++/93589] Template instantiation creates a conversion warning when it should not

2020-02-14 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93589 Jonathan Wakely changed: What|Removed |Added Status|RESOLVED|NEW Last reconfirmed|

[Bug c++/93589] Template instantiation creates a conversion warning when it should not

2020-02-14 Thread jrdowning at yahoo dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93589 John Downing changed: What|Removed |Added CC||jrdowning at yahoo dot com --- Comment

[Bug c++/93589] Template instantiation creates a conversion warning when it should not

2020-02-05 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93589 Jonathan Wakely changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill

[Bug c++/93589] Template instantiation creates a conversion warning when it should not

2020-02-05 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93589 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/93589] Template instantiation creates a conversion warning when it should not

2020-02-05 Thread lokeshjanghel91 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93589 --- Comment #2 from Lokesh Janghel --- >Note your example code does not match the warning message you have in comment >#0. Sorry, I used some reduce test case. here is the correct one: $ g++ -Wconversion test.cpp test.cpp: In instantiation of

[Bug c++/93589] Template instantiation creates a conversion warning when it should not

2020-02-05 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93589 --- Comment #1 from Andrew Pinski --- I don't see the issue here due to promotion rules in C++. Note your example code does not match the warning message you have in comment #0. Just add an extra cast: static_cast((CHAR_BIT * static_cast(i)) <<