Title
constexpr not permitted by the syntax of constructor declarations
Status
c++11
Section
11.4.5 [class.ctor]
Submitter
James Widman

Created on 2008-10-27.00:00:00 last changed 130 months ago

Messages

Date: 2010-08-23.00:00:00

[Voted into WP at August, 2010 meeting.]

Date: 2010-02-15.00:00:00

Proposed resolution (February, 2010):

Change 11.4.5 [class.ctor] paragraph 1 as follows:

Constructors do not have names. A special declarator syntax using an optional sequence of function-specifiers (9.2.3 [dcl.fct.spec]) followed by the constructor's class name followed by a parameter list is used to declare or define the constructor. The syntax uses

  • an optional decl-specifier-seq in which each decl-specifier is either a function-specifier or constexpr,

  • the constructor's class name, and

  • a parameter list

in that order. In such a declaration, optional parentheses around the constructor class name are ignored. [Example:...

Date: 2008-10-27.00:00:00

According to 11.4.5 [class.ctor] paragraph 1, only function-specifiers are permitted in the declaration of a constructor, and constexpr is not a function-specifier. (See also issue 263, in which the resolution of a similar concern regarding the friend specifier did not change 11.4.5 [class.ctor] paragraph 1 but perhaps should have done so.)

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: fdis -> c++11
2011-04-10 00:00:00adminsetstatus: wp -> fdis
2010-11-29 00:00:00adminsetstatus: dr -> wp
2010-08-23 00:00:00adminsetmessages: + msg2918
2010-08-23 00:00:00adminsetstatus: ready -> dr
2010-03-29 00:00:00adminsetstatus: review -> ready
2010-02-16 00:00:00adminsetmessages: + msg2550
2010-02-16 00:00:00adminsetstatus: drafting -> review
2009-03-23 00:00:00adminsetstatus: open -> drafting
2008-10-27 00:00:00admincreate