[Bug c++/87667] -Wformat + typed enum class - difference with clang

2018-10-22 Thread lebedev.ri at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87667 Roman Lebedev changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED See Also|

[Bug c++/87667] -Wformat + typed enum class - difference with clang

2018-10-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87667 --- Comment #3 from Jonathan Wakely --- I think the warning is correct. A scoped enumeration type is not subject to integral promotion, so the argument is not promoted to int. When the body of printf tries to read an int from the argument the

[Bug c++/87667] -Wformat + typed enum class - difference with clang

2018-10-22 Thread lebedev.ri at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87667 --- Comment #2 from Roman Lebedev --- (In reply to Jonathan Wakely from comment #1) > It's a warning, why do you think either compiler is wrong? Either it is incorrect to pass `enum class Enum : unsigned short` when the format specifier is %hx

[Bug c++/87667] -Wformat + typed enum class - difference with clang

2018-10-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87667 --- Comment #1 from Jonathan Wakely --- It's a warning, why do you think either compiler is wrong?