https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107763
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Roman Lebedev from comment #2)> > Is this situation different in C++? looks like i set the component wrong. > Is this implementation-defined behavior, > or are you saying that clang is wrong here? Yes I think clang is wrong. The spec says: "The value is unchanged if the original value is within the range of the enumeration values"