[Bug c++/107813] Enum with underlying type uint8_t bad promotion for unsigned char

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 22 13:28:04 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107813

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
GCC 10 is correct. The template is a exact match for the argument, accepting
any argument type, so the enum should not be converted to unsigned char.

When you call this->o << t then there is no exact match, so an implicit
conversion to unsigned char happens.


More information about the Gcc-bugs mailing list