Deleted default constructor for abstract class
11.4.5 [class.ctor]
Ville Voutilainen

Created on 2013-01-31.00:00:00 last changed 81 months ago


Date: 2014-02-15.00:00:00

[Moved to DR at the February, 2014 meeting.]

Date: 2013-11-15.00:00:00

Proposed resolution (November, 2013):

This issue is resolved by the resolution of issue 1658.

Date: 2013-08-15.00:00:00

Proposed resolution (August, 2013) [superseded]:

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

...A defaulted default constructor for class X is defined as deleted if:

  • ...

  • any direct or virtual base class, or non-static data member with no brace-or-equal-initializer, or any direct base class, or, if X is not abstract, any virtual base class, has class type M (or array thereof) and either M has no default constructor or overload resolution (12.2 [over.match]) as applied to M's default constructor results in an ambiguity or in a function that is deleted or inaccessible from the defaulted default constructor, or

  • ...

Date: 2013-04-15.00:00:00

Notes from the April, 2013 meeting:

CWG agreed that a virtual base class should not cause an abstract class's default constructor to be defined as deleted.

Date: 2013-01-31.00:00:00

Bullet 6 of 11.4.5 [class.ctor] paragraph 5 gives an abstract class a deleted default constructor when the virtual base has no default constructor, even though the abstract class's default constructor can never construct the virtual base class subobject. This seems parallel to the case described in issue 257 for mem-initializers. Should a similar accommodation be made to avoid deleted default constructors in abstract classes?

Date User Action Args
2014-11-24 00:00:00adminsetstatus: dr -> c++14
2014-03-03 00:00:00adminsetmessages: + msg4956
2014-03-03 00:00:00adminsetstatus: tentatively ready -> dr
2014-01-20 00:00:00adminsetmessages: + msg4734
2013-09-03 00:00:00adminsetmessages: + msg4462
2013-09-03 00:00:00adminsetstatus: drafting -> tentatively ready
2013-05-03 00:00:00adminsetmessages: + msg4338
2013-05-03 00:00:00adminsetstatus: open -> drafting
2013-01-31 00:00:00admincreate