Created on 2013-08-28.00:00:00 last changed 31 months ago
[Accepted at the July, 2019 meeting as part of paper P1099R5 (Using enum).]
A using-declaration cannot name a scoped enumerator, according to 9.9 [namespace.udecl] paragraph 7. This is presumably because a scoped enumerator belongs to an enumeration scope and thus logically cannot belong to the non-enumeration scope in which the using-declaration appears. It seems inconsistent, however, to permit using-declarations to name unscoped enumerators but not scoped enumerators.
Also, 9.9 [namespace.udecl] paragraph 3 says,
In a using-declaration used as a member-declaration, the nested-name-specifier shall name a base class of the class being defined.
The consequence of this is that
enum E { e0 }; void f() { using E::e0; }
is well-formed, but
struct B { enum E { e0 }; }; struct D : B { using B::E::e0; };
is not. Again, this seems inconsistent. Should these rules be relaxed?
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-27 08:26:54 | admin | set | status: open -> cd5 |
2013-08-28 00:00:00 | admin | create |