Title
Defaulted destructor and unusable operator delete
Status
c++11
Section
11.4.7 [class.dtor]
Submitter
Jason Merrill

Created on 2010-06-22.00:00:00 last changed 123 months ago

Messages

Date: 2011-03-15.00:00:00

[Voted into the WP at the March, 2011 meeting.]

Date: 2010-11-15.00:00:00

Proposed resolution (November, 2010):

Change 11.4.7 [class.dtor] paragraph 3 as follows:

...A defaulted destructor for a class X is defined as deleted if:

  • X is a union-like class that has a variant member with a non-trivial destructor,

  • any of the non-static data members has class type M (or array thereof) and M has a deleted destructor or a destructor that is inaccessible from the defaulted destructor, or

  • any direct or virtual base class has a deleted destructor or a destructor that is inaccessible from the defaulted destructor.,

  • or, for a virtual destructor, lookup of the non-array deallocation function results in an ambiguity or in a function that is deleted or inaccessible from the defaulted destructor.

A destructor is trivial if...

Date: 2010-06-22.00:00:00

A defaulted destructor should be implicitly defined as deleted if operator delete is deleted or inaccessible.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: fdis -> c++11
2011-04-10 00:00:00adminsetmessages: + msg3364
2011-04-10 00:00:00adminsetstatus: ready -> fdis
2010-11-29 00:00:00adminsetmessages: + msg3059
2010-11-29 00:00:00adminsetstatus: drafting -> ready
2010-06-22 00:00:00admincreate