This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-11-11


1035. Omitted and required decl-specifiers

Section: 11.4  [class.mem]     Status: C++11     Submitter: Daveed Vandevoorde     Date: 2010-02-25

[Voted into the WP at the March, 2011 meeting as part of paper N3262.]

According to 11.4 [class.mem] paragraph 6,

The decl-specifier-seq is omitted in constructor, destructor, and conversion function declarations only.

This is incorrect, as some decl-specifiers (explicit, virtual, inline, constexpr) are permitted in these declarations. Conversely, C.7.6 [diff.dcl], “Banning implicit int,” says,

In C++ a decl-specifier-seq must contain a type-specifier.

This is also incorrect for these declarations.

Proposed resolution (February, 2011) [SUPERSEDED]:

  1. Change 11.4 [class.mem] paragraph 7 as follows:

  2. The decl-specifier-seq is may be omitted in constructor, destructor, and conversion function declarations only; when declaring another kind of member the decl-specifier-seq shall contain a type-specifier that is not a cv-qualifier. The member-declarator-list can be omitted...
  3. Change C.7.6 [diff.dcl], “Banning implicit int,” as follows:

  4. In C++ a decl-specifier-seq must contain a type-specifier, unless it is followed by a declarator for a constructor, a destructor, or a conversion function. In the following example...