This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4580. is_enumerable_type: Definition of "enumerable type" looks strange

Section: 21.4.7 [meta.reflection.queries] Status: New Submitter: S. B. Tam Opened: 2026-05-18 Last modified: 2026-05-24

Priority: Not Prioritized

View other active issues in [meta.reflection.queries].

View all other issues in [meta.reflection.queries].

View all issues with New status.

Discussion:

21.4.7 [meta.reflection.queries] p30 says:

-30- A type T is enumerable from a point P if either

  1. (30.1) — T is a class type complete at point P or

  2. (30.2) — T is an enumeration type defined by a declaration D such that D is reachable from P but P does not occur within an enum-specifier of D (9.8.1 [dcl.enum]).

The second bullet looks strange to a language lawyer: an enum type can only be declared by opaque-enum-declarations and enum-specifiers (9.8.1 [dcl.enum]), and only the latter are definitions (6.2 [basic.def] p2). That is, D must be an enum-specifier. What does it mean to say "an enum-specifier of an enum-specifier"?

I think, instead of saying "an enum-specifier of D", the second bullet could simply refer to D as an enum-specifier.

Proposed resolution:

This wording is relative to N5046.

  1. Modify 21.4.7 [meta.reflection.queries] as indicated:

    consteval bool is_enumerable_type(info r);
    

    -30- A type T is enumerable from a point P if either

    1. (30.1) — T is a class type complete at point P or

    2. (30.2) — T is an enumeration type defined by a declaration an enum-specifier D (9.8.1 [dcl.enum]) such that D is reachable from P but P does not occur within an enum-specifier of D (9.8.1 [dcl.enum]).