gccとclangで挙動が違うC++コード。多分UBを踏んでいるが、どこで踏んでいるかはいまいちよくわかっていない。
@anqou C++20 (n4868) §7.6.1.9/10
https://timsong-cpp.github.io/cppwp/n4868/expr.static.cast#10
> If the enumeration type has a fixed underlying type, the value is first converted to that type by integral conversion, if necessary, and then to the enumeration type.
If the enumeration type does not have a fixed underlying type, the value is unchanged if the original value is within the range of the enumeration values ([dcl.enum]), and otherwise, the behavior is undefined.
ここに該当して未定義動作ですね
https://mastodon.cardina1.red/@lo48576/107192701702283598
分岐したスレへの補足を忘れていた、 UB ではなかったです