[cxx-abi-dev] need mangling for string literals and lifetime-extended temporaries used in static constexpr member initializers and for string literals in constexpr functions

Jason Merrill jason at redhat.com
Fri May 24 20:10:43 UTC 2013


On 05/24/2013 03:57 PM, John McCall wrote:
> The requirement I'm complaining about is that arguably your
> example is guaranteed to work even if get_sptr() is implemented
> thusly:
>
>    inline const char *get_sptr() { return "foo"; }
>
> Because it's a string literal in an extern inline function and so it's
> the same object.

Yes, and the ABI already specifies mangling for such a string literal:

   <local-name> := Z <function encoding> E s [<discriminator>]

Jason



More information about the cxx-abi-dev mailing list