[Bug libstdc++/56158] bad enum values computed by operator~ in ios_base.h

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Feb 6 16:00:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56158

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-02-06 15:59:51 UTC ---
[dcl.enum]/7 "For an enumeration whose underlying type is fixed, the values of
the enumeration are the values of the underlying type."

Because the underlying type in 17.5.2.1.3 is fixed those operations cannot
create a value outside the range of the enumeration type. See "The underlying
type should be fixed" in
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3110.html



More information about the Gcc-bugs mailing list