Title
Triviality with deleted and missing default constructors
Status
cd4
Section
11.3 [class.name]
Submitter
Daniel Krügler

Created on 2012-04-25.00:00:00 last changed 87 months ago

Messages

Date: 2015-10-15.00:00:00

Proposed resolution (October, 2015):

Change Clause 11 [class] paragraph 6 as follows:

A trivial class is a class that has a default constructor (11.4.5 [class.ctor]), has no non-trivial default constructors, and is trivially copyable and has one or more default constructors (11.4.5 [class.ctor]), all of which are either trivial or deleted and at least one of which is not deleted. [Note: In particular, a trivially copyable or trivial class does not have virtual functions or virtual base classes. —end note]
Date: 2013-09-15.00:00:00

Notes from the September, 2013 meeting:

It was decided to resolve issue 1344 separately from this issue, so this issue now requires its own resolution.

Date: 2012-10-15.00:00:00

Notes from the October, 2012 meeting:

It was observed that this issue was related to issue 1344, as the current specification allows adding a default constructor by adding default arguments to the definition of a constructor. The resolution of that issue should also resolve this one.

Date: 2016-02-15.00:00:00

[Adopted at the February, 2016 meeting.]

A default constructor that is defined as deleted is trivial, according to 11.4.5 [class.ctor] paragraph 5. This means that, according to Clause 11 [class] paragraph 6, such a class can be trivial. If, however, the class has no default constructor because it has a user-declared constructor, the class is not trivial. Since both cases prevent default construction of the class, it is not clear why there is a difference in triviality between the cases.

(See also issue 1928.)

History
Date User Action Args
2017-02-06 00:00:00adminsetstatus: tentatively ready -> cd4
2015-11-10 00:00:00adminsetmessages: + msg5603
2015-11-10 00:00:00adminsetstatus: drafting -> tentatively ready
2013-10-14 00:00:00adminsetmessages: + msg4626
2012-11-03 00:00:00adminsetmessages: + msg4098
2012-11-03 00:00:00adminsetstatus: open -> drafting
2012-04-25 00:00:00admincreate