PR18044: Reject declarations of enumtype::X early to avoid an assertion in
downstream code.