This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115d. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-10-26
[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.
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.
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.
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.
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.