[Bug c++/92158] Enum warning when -1 enum converted to unsigned int

2019-10-25 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92158 --- Comment #8 from Jonathan Wakely --- No, there's no need for a new bug.

[Bug c++/92158] Enum warning when -1 enum converted to unsigned int

2019-10-25 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92158 --- Comment #7 from Jonny Grant --- > Would it be better if I re-file this ticket as implement -Wsign-conversion > for C++ ? I mean expand -Wsign-conversion for C++ to detect the enum conversion that the same option does for C code.

[Bug c++/92158] Enum warning when -1 enum converted to unsigned int

2019-10-25 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92158 --- Comment #6 from Jonny Grant --- Many thanks for your reply. Would you rather I close this and create a new ticket with just your test case so it is clearer on bugzilla? Just to note, gcc trunk shows a warning in C - but oddly g++ does not fo

[Bug c++/92158] Enum warning when -1 enum converted to unsigned int or int

2019-10-25 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92158 Jonathan Wakely changed: What|Removed |Added Status|WAITING |NEW --- Comment #5 from Jonathan Wakel

[Bug c++/92158] Enum warning when -1 enum converted to unsigned int or int

2019-10-22 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92158 --- Comment #4 from Jonny Grant --- Hello Implicit conversion can introduce bugs. I would like to detect implicit enum conversions to other types in C and C++. How about just adding the C++ warnings first to match clang in example below? The fo

[Bug c++/92158] Enum warning when -1 enum converted to unsigned int or int

2019-10-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92158 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |WAITING Last reconfirmed|

[Bug c++/92158] Enum warning when -1 enum converted to unsigned int or int

2019-10-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92158 --- Comment #2 from Jonathan Wakely --- At least when the sign doesn't change, i.e. for conversion to int. Please clarify what exactly you want a warning to do.

[Bug c++/92158] Enum warning when -1 enum converted to unsigned int or int

2019-10-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92158 --- Comment #1 from Jonathan Wakely --- Converting to integral types is a feature of enums, I see no reason to warn.

[Bug c++/92158] Enum warning when -1 enum converted to unsigned int or int

2019-10-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92158 Richard Biener changed: What|Removed |Added Keywords||diagnostic Version|unknown