[cxx-abi-dev] Mangling of function reference
rjmccall at apple.com
Fri May 11 01:58:21 UTC 2012
On May 10, 2012, at 2:17 PM, Marc Glisse wrote:
> it seems that the mangling used by clang and proposed here (although it hasn't made it to the document on the web) is the same for:
> void (&)() // reference to a function
> void ()&
> where the second one is what you get from a pointer to a member function that takes its *this argument by reference, when you remove the "pointer to member" part of the type. I gave a few more details there:
> Am I missing something in the analysis? Is this on purpose because the two are unlikely to conflict?
There are two language constraints preventing a conflict here: first, you can't have a <ref-qualifier> on a function type that isn't immediately used to declare a member function or a pointer-to-member-function; and second, you can't form a member pointer to a field of reference type.
If the first restriction were lifted, you're correct that we'd have to come up with a new mangling for such types written abstractly.
More information about the cxx-abi-dev