Date: Wed, 05 Jun 2024 17:08:25 -0700
On Wednesday 5 June 2024 15:37:30 GMT-7 Frederick Virchanza Gotham via Std-
Proposals wrote:
> C++ has never allowed us to take the address of a constructor or
> destructor, but this has always been a needless restriction.
Except it's not needless.
In the IA-64 C++ ABI, there are three types of constructors (base, complete,
allocating*) and three types of destructors (base, complete, deallocating),
which are important for polymorphic classes and those with virtual bases. The
ABI for calling them need not follow the standard function call ABI and in
fact it does *not*.
1) on 32-bit MSVC, are constructors and destructors __cdecl or __thiscall?
2) on IA-64 C++ ABI, the base constructors (mangling "C2") have an extra
parameter passed implicitly, which is a pointer to the virtual-table-in-
construction (a "TC" symbol). There's no way that user code could ever call
this constructor.
[*] allocating constructors aren't used by any compiler I know of.
Proposals wrote:
> C++ has never allowed us to take the address of a constructor or
> destructor, but this has always been a needless restriction.
Except it's not needless.
In the IA-64 C++ ABI, there are three types of constructors (base, complete,
allocating*) and three types of destructors (base, complete, deallocating),
which are important for polymorphic classes and those with virtual bases. The
ABI for calling them need not follow the standard function call ABI and in
fact it does *not*.
1) on 32-bit MSVC, are constructors and destructors __cdecl or __thiscall?
2) on IA-64 C++ ABI, the base constructors (mangling "C2") have an extra
parameter passed implicitly, which is a pointer to the virtual-table-in-
construction (a "TC" symbol). There's no way that user code could ever call
this constructor.
[*] allocating constructors aren't used by any compiler I know of.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Principal Engineer - Intel DCAI Fleet Engineering and Quality
Received on 2024-06-06 00:08:33