[cxx-abi-dev] Mangling string constants

Dennis Handly dhandly at cup.hp.com
Fri Feb 20 07:44:44 UTC 2015


>From: David Majnemer <david.majnemer at gmail.com>
>It seems that the ABI has no means to mangle the contents of string constants.

Why is that needed?
The current scheme is to just number the constants in order.
And that handles both strings and wide strings.
And by the ODR rule the inlines must be the same.

>the proposal doesn't specify how to mangle UTF-16/UTF-32 string literals.
>Such a mangling would have to specify the endianness used to encode the code
>points.

Again why?  We just need mangling to make sure they match addresses.
Do we really to check code enforcement?
We don't do for narrow vs wide.

>I am trying to figure out how we should mangle the string constant in:
>struct X {
>  static constexpr const char *p = "foo";
>};

I thought this was defined?


More information about the cxx-abi-dev mailing list