mastodon.cardina1.red は、数々の独立したMastodonサーバーのうちのひとつです。サーバーに登録してFediverseのコミュニティに加わってみませんか。

サーバーの情報

3
人のアクティブユーザー

gccとclangで挙動が違うC++コード。多分UBを踏んでいるが、どこで踏んでいるかはいまいちよくわかっていない。

@anqou C++20 (n4868) §7.6.1.9/10
timsong-cpp.github.io/cppwp/n4

> 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.

ここに該当して未定義動作ですね

timsong-cpp.github.io[expr.static.cast]