CWG Issue 2156 (original) (raw)
This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-11-05
2156. Definition of enumeration declared by using-declaration
Section: 9.8.1 [dcl.enum]Status: CD4Submitter: Richard SmithDate: 2015-07-06
[Adopted at the February, 2016 meeting.]
The description of enumeration declarations in 9.8.1 [dcl.enum] does not, but should, contain similar wording to that preventing a class definition from defining a class type named by a_using-declaration_:
If a class-head-name contains a nested-name-specifier, the _class-specifier_shall refer to a class that was previously declared directly in the class or namespace to which the nested-name-specifier refers, or in an element of the inline namespace set (9.9.2 [namespace.def]) of that namespace (i.e., not merely inherited or introduced by a using-declaration), and the _class-specifier_shall appear in a namespace enclosing the previous declaration. In such cases, the nested-name-specifier of the class-head-name of the definition shall not begin with a decltype-specifier.
Proposed resolution (February, 2016):
Add the following as a new paragraph at the end of 9.8.1 [dcl.enum]:
If an enum-head contains a nested-name-specifier, the enum-specifier shall refer to an enumeration that was previously declared directly in the class or namespace to which the_nested-name-specifier_ refers, or in an element of the inline namespace set (9.9.2 [namespace.def]) of that namespace (i.e., not merely inherited or introduced by a using-declaration), and the _enum-specifier_shall appear in a namespace enclosing the previous declaration. In such cases, the nested-name-specifier of the enum-head of the definition shall not begin with a decltype-specifier.