Title
When are inheriting constructors declared?
Status
cd3
Section
_N4527_.12.9 [class.inhctor]
Submitter
Richard Smith

Created on 2012-03-27.00:00:00 last changed 130 months ago

Messages

Date: 2013-04-15.00:00:00

[Moved to DR at the April, 2013 meeting.]

Date: 2013-02-15.00:00:00

Additional note (February, 2013):

It was observed that it is not permitted to derive from an incomplete class, which prevents the problem intended to be addressed by the prohibition of inheriting constructors from an enclosing class without disallowing such usage when the nested class is defined outside its enclosing class. That restriction has been removed from the proposed resolution.

Date: 2013-01-15.00:00:00

Additional note (January, 2013):

A question has been raised as to whether it is necessary to prohibit inheriting constructors from base classes that are also enclosing classes when the derived class is defined outside the member-specification of the enclosing class. This issue has been returned to "review" status to allow discussion of this question.

Date: 2013-02-15.00:00:00

Proposed resolution (February, 2013):

  1. Change 11.4 [class.mem] paragraph 2 as follows:

  2. A class is considered a completely-defined object type (6.8 [basic.types]) (or complete type) at the closing } of the class-specifier. Within the class member-specification, the class is regarded as complete within function bodies, default arguments, using-declarations introducing inheriting constructors (_N4527_.12.9 [class.inhctor]), and brace-or-equal-initializers for non-static data members (including such things in nested classes). Otherwise it is regarded as incomplete within its own class member-specification.
  3. Change 11.4.4 [special] paragraph 1 as follows:

  4. ...See 11.4.5 [class.ctor], 11.4.7 [class.dtor] and 11.4.5.3 [class.copy.ctor]. —end note] An implicitly-declared special member function is declared at the closing } of the class-specifier. Programs shall not define implicitly-declared special member functions.
  5. Change _N4527_.12.9 [class.inhctor] paragraph 3 as follows:

  6. For each non-template constructor in the candidate set of inherited constructors other than a constructor having no parameters or a copy/move constructor having a single parameter, a constructor is implicitly declared with the same constructor characteristics unless there is a user-declared constructor with the same signature in the complete class where the using-declaration appears. Similarly, for each constructor template in the candidate set of inherited constructors, a constructor template is implicitly declared with the same constructor characteristics unless there is an equivalent user-declared constructor template (13.7.7.2 [temp.over.link]) in the complete class where the using-declaration appears. [Note: Default arguments are not inherited. An exception-specification is implied as specified in 14.5 [except.spec]. —end note]
Date: 2016-02-15.00:00:00

According to _N4527_.12.9 [class.inhctor] paragraph 3,

For each non-template constructor in the candidate set of inherited constructors other than a constructor having no parameters or a copy/move constructor having a single parameter, a constructor is implicitly declared with the same constructor characteristics unless there is a user-declared constructor with the same signature in the class where the using-declaration appears.

It is not clear whether that determination is intended to include constructors declared after the point of the using-declaration or not.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-10-14 00:00:00adminsetstatus: dr -> drwp
2013-05-03 00:00:00adminsetmessages: + msg4417
2013-05-03 00:00:00adminsetstatus: tentatively ready -> dr
2013-03-18 00:00:00adminsetmessages: + msg4249
2013-03-18 00:00:00adminsetstatus: review -> tentatively ready
2013-01-14 00:00:00adminsetmessages: + msg4205
2013-01-14 00:00:00adminsetmessages: + msg4204
2013-01-14 00:00:00adminsetstatus: drafting -> review
2012-11-03 00:00:00adminsetstatus: open -> drafting
2012-03-27 00:00:00admincreate