Exception specifications on template destructors
11.4.7 [class.dtor]
Jason Merrill

Created on 2012-04-01.00:00:00 last changed 49 months ago


Date: 2014-11-15.00:00:00

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

Date: 2013-04-15.00:00:00

Notes from the April, 2013 meeting:

This issue was approved as a DR at the April, 2013 (Bristol) meeting, but it was not noticed that issue 1552 was not being moved at that time. It is being returned to "drafting" status pending the resolution of that issue.

Date: 2014-02-15.00:00:00

Proposed resolution (February, 2014):

This issue is resolved by the resolution of issue 1552.

Date: 2012-04-01.00:00:00

According to 11.4.7 [class.dtor] paragraph 3,

A declaration of a destructor that does not have an exception-specification is implicitly considered to have the same exception-specification as an implicit declaration (14.5 [except.spec]).

The implications of this are not clear for the destructor of a class template. For example,

  template <class T> struct B: T {
  template <class T> B<T>::~B() noexcept {}

The implicit exception-specification of the in-class declaration of the destructor depends on the characteristics of the template argument. Does this mean that the out-of-class definition of the destructor is ill-formed, or will it be ill-formed only in specializations where the template argument causes the implicit exception-specification to be other than noexcept?

Date User Action Args
2017-02-06 00:00:00adminsetstatus: drwp -> cd4
2015-05-25 00:00:00adminsetstatus: dr -> drwp
2015-04-13 00:00:00adminsetmessages: + msg5396
2014-11-24 00:00:00adminsetstatus: ready -> dr
2014-03-03 00:00:00adminsetstatus: drafting -> ready
2013-05-03 00:00:00adminsetmessages: + msg4340
2013-05-03 00:00:00adminsetstatus: tentatively ready -> drafting
2012-11-03 00:00:00adminsetmessages: + msg4077
2012-11-03 00:00:00adminsetstatus: open -> tentatively ready
2012-04-01 00:00:00admincreate