[cxx-abi-dev] Mangling string constants

David Majnemer david.majnemer at gmail.com
Thu Feb 19 22:51:19 UTC 2015


Hi,

It seems that the ABI has no means to mangle the contents of string
constants.

The cxx-abi-dev archives have a proposal
http://sourcerytools.com/pipermail/cxx-abi-dev/2012-January/000032.html but
it seems this was never integrated into the ABI document.  Further, 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.

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

We are required to give the storage for the string the same name in all
translation units in order to adhere to the ODR.

One idea I had was to treat it like a lifetime extended temporary but this
might break compatibility with existing programs.

Are there any preferences as to what should be done?

-- 
David Majnemer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/cxx-abi-dev/attachments/20150219/7d0b101b/attachment.html>


More information about the cxx-abi-dev mailing list