Created on 2012-03-27.00:00:00 last changed 90 months ago
[Moved to DR at the April, 2013 meeting.]
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.
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.
Proposed resolution (February, 2013):
Change 11.4 [class.mem] paragraph 2 as follows:
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, 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.
Change 11.4.4 [special] paragraph 1 as follows:
...See 11.4.5 [class.ctor], 11.4.7 [class.dtor] and _N4750_.15.8 [class.copy]. —end note] Programs shall not define implicitly-declared special member functions.
Change _N4527_.12.9 [class.inhctor] paragraph 3 as follows:
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. 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 (22.214.171.124 [temp.over.link]) in the 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]
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.
|2014-03-03 00:00:00||admin||set||status: drwp -> cd3|
|2013-10-14 00:00:00||admin||set||status: dr -> drwp|
|2013-05-03 00:00:00||admin||set||messages: + msg4417|
|2013-05-03 00:00:00||admin||set||status: tentatively ready -> dr|
|2013-03-18 00:00:00||admin||set||messages: + msg4249|
|2013-03-18 00:00:00||admin||set||status: review -> tentatively ready|
|2013-01-14 00:00:00||admin||set||messages: + msg4205|
|2013-01-14 00:00:00||admin||set||messages: + msg4204|
|2013-01-14 00:00:00||admin||set||status: drafting -> review|
|2012-11-03 00:00:00||admin||set||status: open -> drafting|