Title
Kind of lookup for using enum declarations
Status
ready
Section
9.7.2 [enum.udecl]
Submitter
Sean Baxter

Created on 2022-08-17.00:00:00 last changed 5 days ago

Messages

Date: 2022-09-24.20:32:26

Proposed resolution (approved by CWG 2022-09-23):

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.
Date: 2022-09-24.20:32:26

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.

Date: 2022-09-09.21:10:51

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
2022-09-24 20:32:26adminsetmessages: + msg6947
2022-09-24 20:32:26adminsetstatus: drafting -> ready
2022-09-09 21:10:51adminsetstatus: open -> drafting
2022-09-02 07:54:02adminsetmessages: + msg6920
2022-08-17 00:00:00admincreate