https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89408
--- Comment #6 from joseph at codesourcery dot com <joseph at codesourcery dot com> --- Case labels are required to be integer constant expressions. In most cases where an integer constant expression is required, something that isn't an integer constant expression but folds to an integer constant is accepted with a pedwarn-if-pedantic (see c-typeck.cc:do_case for this in the case of case labels, where the diagnostic is "case label is not an integer constant expression"). *But* note that this is mainly for compatibility with pre-GCC-4.5 code depending on folding that occurred before GCC 4.5; as I said in <https://gcc.gnu.org/pipermail/gcc/2021-July/236945.html>, it's not any sort of designed, documented extension with stable semantics that it would be a good idea to use.