Created on 2022-08-17.00:00:00 last changed 16 months ago
Proposed resolution (approved by CWG 2022-11-10):
Change the grammar before 9.2.9.5 [dcl.type.elab] paragraph 1 as follows, merging the grammar productions:
elaborated-type-specifier : class-key attribute-specifier-seqopt nested-name-specifieropt identifier class-key simple-template-id class-key nested-name-specifier templateopt simple-template-idelaborated-enum-specifier elaborated-enum-specifier :enum nested-name-specifieropt identifier
Change the grammar before 9.7.2 [enum.udecl] paragraph 1 as follows:
using-enum-declaration: usingelaborated-enum-specifierenum using-enum-declarator ; using-enum-declarator: nested-name-specifieropt identifier nested-name-specifieropt simple-template-id
Change in 9.7.2 [enum.udecl] paragraph 1 as follows:
A using-enum-declarator names the set of declarations found by lookup (6.5.3 [basic.lookup.unqual], 6.5.5 [basic.lookup.qual]) for the using-enum-declarator. Theelaborated-enum-specifierusing-enum-declarator shallnot name a dependentdesignate a non-dependent typeand the type shall havewith a reachable enum-specifier.
Proposed resolution (approved by CWG 2022-09-23) [SUPERSEDED]:
Change in 9.7.2 [enum.udecl] paragraph 1 as follows:
The terminal name of the elaborated-enum-specifier undergoes ordinary lookup (6.5.3 [basic.lookup.unqual], 6.5.5 [basic.lookup.qual]). The elaborated-enum-specifier shall not name a dependent type and the type shall have a reachable enum-specifier.
CWG 2022-11-07:
Use the wording approach presented in CA-054, with necessary adjunct fixes.
CWG telecon 2022-09-09:
The example at #1 is intended to be valid; even though the grammar suggests that an elaborated-type-specifier is used here, an ordinary (not a type-only) lookup is performed.
Suggested resolution [SUPERSEDED]:
Change in 9.7.2 [enum.udecl] paragraph 1 as follows:
Lookup for the elaborated-enum-specifier is as specified in 6.5.6 [basic.lookup.elab]. The elaborated-enum-specifier shall not name a dependent type and the type shall have a reachable enum-specifier.
[Accepted as a DR at the November, 2022 meeting.]
Consider:
enum class E {
a, b, c
};
using MyE = E;
int main() {
using enum MyE; // #1
}
Does the lookup for the elaborated-enum-specifier at #1 use type-only lookup per 6.5.6 [basic.lookup.elab]? There is implementation divergence; EDG, gcc, and MSVC accept, clang rejects.
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: drwp -> open |
2023-02-18 18:43:04 | admin | set | status: dr -> drwp |
2022-11-25 05:14:04 | admin | set | status: nb -> dr |
2022-11-10 21:59:09 | admin | set | status: review -> nb |
2022-11-10 21:59:09 | admin | set | status: review -> review |
2022-11-10 21:59:09 | admin | set | status: review -> review |
2022-11-10 21:59:09 | admin | set | status: review -> review |
2022-11-10 14:29:24 | admin | set | messages: + msg7013 |
2022-11-10 14:29:24 | admin | set | messages: + msg6992 |
2022-11-08 13:17:36 | admin | set | status: nb -> review |
2022-11-08 13:17:36 | admin | set | messages: + msg7010 |
2022-11-08 13:17:36 | admin | set | status: nb -> nb |
2022-11-08 13:17:36 | admin | set | status: nb -> nb |
2022-11-08 13:17:36 | admin | set | status: ready -> nb |
2022-09-24 20:32:26 | admin | set | messages: + msg6947 |
2022-09-24 20:32:26 | admin | set | status: drafting -> ready |
2022-09-09 21:10:51 | admin | set | status: open -> drafting |
2022-09-02 07:54:02 | admin | set | messages: + msg6920 |
2022-08-17 00:00:00 | admin | create |