Created on 2021-10-03.00:00:00 last changed 16 months ago
Proposed resolution (approved by CWG 2023-02-06):
The locus of an enum-specifieror opaque-enum-declarationis immediately afterthe identifier (if any) in itits enum-head; the locus of an opaque-enum-declaration is immediately after it (9.7.1 [dcl.enum]).
CWG 2022-11-11
Move the locus to immediately after the enum-head.
[Accepted as a DR at the February, 2023 meeting.]
According to 6.4.2 [basic.scope.pdecl] paragraph 3,
The locus of an enum-specifier or opaque-enum-declaration is immediately after the identifier (if any) in it (9.7.1 [dcl.enum]).
Equivalent wording has been present for a very long time; see, for instance, issue 1482. However, most or all implementations reject the example from that issue:
template<typename T> struct S { typedef char I; }; enum E: S<E>::I { e }; // Implementations say E is undeclared in S<E>
In addition to recognizing current implementation practice, it would be practically useful if the locus were specified instead as after the enum-head or complete opaque-enum-declaration, as it would allow use of SFINAE in std::is_scoped_enum to distinguish between scoped and unscoped enumerations rather than requiring special compiler support.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-07-16 13:00:43 | admin | set | status: open -> c++23 |
2023-07-16 13:00:43 | admin | set | status: dr -> open |
2023-02-18 18:43:04 | admin | set | status: ready -> dr |
2023-02-10 23:01:52 | admin | set | messages: + msg7191 |
2023-02-10 23:01:52 | admin | set | status: tentatively ready -> ready |
2023-02-07 06:06:05 | admin | set | status: review -> tentatively ready |
2022-11-20 07:54:16 | admin | set | messages: + msg7045 |
2022-11-20 07:54:16 | admin | set | status: open -> review |
2021-10-03 00:00:00 | admin | create |