CWG Issue 1638 (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


1638. Declaring an explicit specialization of a scoped enumeration

Section: 9.8.1 [dcl.enum]Status: CD4Submitter: Richard SmithDate: 2013-03-12

[Adopted at the February, 2016 meeting.]

There is no syntax currently for declaring an explicit specialization of a member scoped enumeration. A declaration (not a definition) of such an explicit specialization most resembles an opaque-enum-declaration, but the grammar for that requires that the name be a simple identifier, which will not be the case for an explicit specialization of a member enumeration. This could be remedied by adding a nested-name-specifier to the grammar with a restriction that a nested-name-specifier only appear in an explicit specialization.

Proposed resolution (October, 2015):

  1. Change the grammar in 9.8.1 [dcl.enum] paragraph 1 as follows: opaque-enum-declaration: enum-key attribute-specifier-seqopt nested-name-specifieropt identifier enum-baseopt ;
  2. Add the following at the end of 9.8.1 [dcl.enum] paragraph 1:

If an opaque-enum-declaration contains a_nested-name-specifier_, the declaration shall be an explicit specialization (13.9.4 [temp.expl.spec]).