You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per http://wg21.link/p0136r1 an inheriting constructor declaration no longer results in the implicit synthesis of derived class constructors, and instead the behavior of a call to an inherited constructor is that:
the portion of a hypothetical defaulted default constructor prior to the base constructor invocation is executed, then
the inherited constructor is invoked, then
the portion of a hypothetical defaulted default constructor after the base constructor invocation is executed
Proposal:
To avoid emitting the code for (1) and (3) in every inherited constructor call site, add a new form of mangled name for a fake constructor that forwards to a base class constructor, whose <encoding> is that of the base class constructor, except that the <nested-name> is that of the derived class and the <unqualified-name> is
<ctor-dtor-name> ::= CI1 <base class type> # complete object inheriting constructor <ctor-dtor-name> ::= CI2 <base class type> # base object inheriting constructor
This would give code largely similar to what we generate with the C++11 inheriting constructor rules, except that the additional copy constructions and destructions for parameters would be removed.
The usage of this mangling would be entirely optional; the purpose of including this mangling in the ABI is only to coalesce multiple weak definitions of the same symbol. If an implementation can't forward all the arguments (eg for varargs constructors) or just doesn't want to emit these symbols, the full initialization can be inlined instead (or another technique can be used).
As usual, CI2 constructors do not construct virtual base class subobjects. As a consequence, when a constructor is inherited from a virtual base, the corresponding CI2 symbol does not need the formal parameters, so they are not passed.
The text was updated successfully, but these errors were encountered:
[Imported from cxx-abi-dev]
Per http://wg21.link/p0136r1 an inheriting constructor declaration no longer results in the implicit synthesis of derived class constructors, and instead the behavior of a call to an inherited constructor is that:
Proposal:
To avoid emitting the code for (1) and (3) in every inherited constructor call site, add a new form of mangled name for a fake constructor that forwards to a base class constructor, whose
<encoding>
is that of the base class constructor, except that the<nested-name>
is that of the derived class and the<unqualified-name>
is<ctor-dtor-name> ::= CI1 <
base class
type> # complete object inheriting constructor
<ctor-dtor-name> ::= CI2 <
base class
type> # base object inheriting constructor
This would give code largely similar to what we generate with the C++11 inheriting constructor rules, except that the additional copy constructions and destructions for parameters would be removed.
The usage of this mangling would be entirely optional; the purpose of including this mangling in the ABI is only to coalesce multiple weak definitions of the same symbol. If an implementation can't forward all the arguments (eg for varargs constructors) or just doesn't want to emit these symbols, the full initialization can be inlined instead (or another technique can be used).
As usual,
CI2
constructors do not construct virtual base class subobjects. As a consequence, when a constructor is inherited from a virtual base, the correspondingCI2
symbol does not need the formal parameters, so they are not passed.The text was updated successfully, but these errors were encountered: