This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 113d. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-03-20


1146. exception-specifications of defaulted functions

Section: 11.4.7  [class.dtor]     Status: C++11     Submitter: GB     Date: 2010-08-03

[Voted into the WP at the November, 2010 meeting.]

N3092 comment GB 39
N3092 comment GB 41

The note in 11.4.7 [class.dtor] paragraph 4 says,

An explictly defaulted definition has no implicit exception-specification.

There are similar notes in 11.4.5.3 [class.copy.ctor] paragraphs 15 and 29.

However, 9.5.2 [dcl.fct.def.default] bullet 2.4 says that a special member function that is explicitly defaulted on its first declaration

is implicitly considered to have the same exception-specification as if it had been implicitly declared (14.5 [except.spec])

The notes are incorrect.

Proposed resolution (August, 2010):

  1. Change 11.4.7 [class.dtor] paragraph 4 as follows:

  2. [Note: an implicitly- declared destructor has an exception-specification (15.4). An explictly defaulted definition has no implicit exception-specification.end note]
  3. Change 11.4.5.3 [class.copy.ctor] paragraph 15 as follows:

  4. [Note: an implicitly-declared copy/move constructor has an exception-specification (15.4). An explicitly-defaulted definition (8.4.2) has no implicit exception-specification.end note]
  5. Change 11.4.5.3 [class.copy.ctor] paragraph 29 as follows:

  6. [Note: An implicitly-declared copy/move assignment operator has an exception- specification (15.4). An explicitly-defaulted definition has no implicit exception-specification.end note]