C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Allow conversion of memfunc pointers to func pointers

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sun, 14 Jan 2024 18:04:29 -0800
On Sunday, 14 January 2024 16:27:31 PST connor horman via Std-Proposals wrote:
> Not to mention, you've got (at least) two incompatible name mangling ABIs,
> and I doubt very much that either will want to break basically every one of
> their users by so radically altering their definition.

There's the ABI that everyone but one uses, and there's the defective ABI. The
vendor using that defective ABI should really make a plan to fix it, so it may
as well figure out if there's a "flag day" when they just switch to the common
ABI.

That ABI has several known defects, including:
* improper mangling of expressions in templates, causing instantiations that
  should differ to clash
* mangling the difference between struct and class, when the standard says they
  are exactly the same
* different sizes for PMFs depending on the class hierarchy, causing forward
  declarations of PMFs to be effectively impossible

Those aren't just quirks of the ABI. They cause failures to conform to the C++
standard. Their correction requires ABI breaks, going from "obscure corners"
to "everything in C++" (for the class/struct difference).

But this is a standards-discussion list and the standard has no power over ABI
or enforcing compiler's conformance. I'm just ranting that this particular
vendor should have corrected their mistakes two decades ago, but hasn't.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2024-01-15 02:04:32