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

2024-10-26


1350. Incorrect exception specification for inherited constructors

Section: _N4527_.12.9  [class.inhctor]     Status: CD3     Submitter:     Date: 2011-08-16

[Voted into the WP at the February, 2012 meeting; moved to DR at the October, 2012 meeting.]

According to _N4527_.12.9 [class.inhctor] paragraph 3, the exception specification for an inheriting constructor has the same exception specification as the inherited constructor. This ignores the exception specifications of default constructors for base classes and nonstatic data members and of functions called in brace-or-equals-initializers of nonstatic data members.

Proposed resolution (August, 2011):

  1. Delete the indicated bullet of _N4527_.12.9 [class.inhctor] paragraph 2:

  2. Change _N4527_.12.9 [class.inhctor] paragraph 3 as follows:

  3. ...[Note: Default arguments are not inherited. An exception-specification is implied as specified in 14.5 [except.spec].end note]
  4. Change 14.5 [except.spec] paragraph 14 as follows:

  5. An inheriting constructor (_N4527_.12.9 [class.inhctor]) and an implicitly declared special member function ( 11.4.4 [special]) shall have an exception-specification. If f is an inheriting constructor or an implicitly declared default constructor, copy constructor, move constructor, destructor, copy assignment operator, or move assignment operator, its implicit exception-specification specifies the type-id T if and only if T is allowed by the exception-specification of a function directly invoked by f's implicit definition; f shall allow all exceptions if any function it directly invokes allows all exceptions, and f shall allow no exceptions if every function it directly invokes allows no exceptions. [Note: an instantiation of an inheriting constructor template has an implied exception-specification as if it were a non-template inheriting constructor. —end note] [Example:...