Title
Point of declaration of enumeration
Status
cd3
Section
6.4.2 [basic.scope.pdecl]
Submitter
Daveed Vandevoorde

Created on 2012-03-20.00:00:00 last changed 130 months ago

Messages

Date: 2013-04-15.00:00:00

[Moved to DR at the April, 2013 meeting.]

Date: 2012-12-15.00:00:00

Proposed resolution (December, 2012):

  1. Change 6.8 [basic.types] paragraph 5 as follows:

  2. A class that has been declared but not defined, an enumeration type in certain contexts (9.7.1 [dcl.enum]), or an array of unknown size or of incomplete element type, is an incompletely-defined object type.43 Incompletely-defined object types...
  3. Add the following as a new paragraph preceding 9.7.1 [dcl.enum] paragraph 6:

  4. An enumeration whose underlying type is fixed is an incomplete type from its point of declaration (6.4.2 [basic.scope.pdecl]) to immediately after its enum-base (if any), at which point it becomes a complete type. An enumeration whose underlying type is not fixed is an incomplete type from its point of declaration to immediately after the closing } of its enum-specifier, at which point it becomes a complete type.

    For an enumeration whose underlying type is not fixed...

This resolution also resolves issue 977.

Date: 2012-11-03.00:00:00

According to 6.4.2 [basic.scope.pdecl] paragraph 2,

The point of declaration for an enumeration is immediately after the identifier (if any) in either its enum-specifier (9.7.1 [dcl.enum]) or its first opaque-enum-declaration (9.7.1 [dcl.enum]), whichever comes first.

This would make the following example well-formed:

  template<typename T> struct S { typedef char I; };
  enum E: S<E>::I { e };

Presumably that would make E an incomplete enumeration type for the instantiation of S<E> (a concept not otherwise found in the Standard). However, some implementations reject this example, presumably making the point of declaration after the enum-base. We either need to make it ill-formed or describe incomplete enumeration types.

See also issue 977.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-10-14 00:00:00adminsetstatus: dr -> drwp
2013-05-03 00:00:00adminsetmessages: + msg4369
2013-05-03 00:00:00adminsetstatus: tentatively ready -> dr
2013-01-14 00:00:00adminsetmessages: + msg4195
2013-01-14 00:00:00adminsetstatus: drafting -> tentatively ready
2012-11-03 00:00:00adminsetstatus: open -> drafting
2012-03-20 00:00:00admincreate