https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81665
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Daniel Fruzynski from comment #0) > - to eliminate above error, one has to define custom | operator for enum > type. However when it is not marked as a constexpr, it causes another > compilation error when its result is used as a case value: > test-enum-op.c:25:15: error: call to non-constexpr function ‘Values > operator|(Values, Values)’ > case Val2 | Val3: > ^ So mark it constexpr then. Getting an error for incorrect code is good. (I have no comment on the rest of the report).