[patch] New std::string implementation

François Dumont frs.dumont@gmail.com
Sat Dec 20 00:19:00 GMT 2014


Hello

     Great news.

     However we need the following to make debug/profile modes happy.

     Shouldn't we use _GLIBCXX_ABI_TAG_CXX11 to tag the __cxx11 namespace ?

2014-12-20  François Dumont  <fdumont@gcc.gnu.org>

     * include/bits/c++config: inline __cxx11 namespace within namespace
     __cxx1998.

Ok to commit ?

François


On 19/12/2014 19:23, Jonathan Wakely wrote:
> The powerpc64 ICE is fixed, so I'm committing the std::string ABI
> transition patch.
>
> This replaces our venerable Copy-on-Write std::string with a
> C++11-conforming* Small-String Optimized std::__cxx11::string.
>
> (* It's not quite 100% conforming, as it's missing some allocator
> features.  Of course. Always with the allocators. But that's only a
> small fix to make next week.)
>
> Since the last version of this patch Jason has added support for
> attribute((abi_tag)) on namespaces, so the new types can be defined in
> an inline namespace that has the tag, rather than co-existing in
> namespace std with the un-tagged types. This makes overloading and
> exporting symbols a bit more straightforward as the different linkage
> names can be expressed with a fully-qualified name without needing the
> attribute.
>
> I've also added regex templates to the new __cxx11 namespace, as they
> depend on std::string.
>
> There are now two new configure options, --disable-libstdcxx-dual-abi
> and --with-default-libstdcxx-abi. The former disables all support for
> the new __cxx11 ABI pieces. The latter is only relevant when the dual
> ABI is enabled and can be used to make the old definitions the
> default ones you get without defining the _GLIBCXX_USE_CXX11_ABI
> macro.
>
> As described previously, the locale facets that depend on the
> std::string ABI exist twice as "twinned facets" and if users replace
> a twinned facet the library generates a shim to replace its twin.
>
> Also as described previously, the types in <stdexcept> continue to use
> the COW string, to ensure nothrow copying and ABI stability.
>
> The Python pretty printer problems I was seeing with the new string
> turned out to be a GDB bug (17728).
>
> Target maintainers will see a *lot* of new exports at the latest
> symbol version if they generate a new baseline-symbols.txt file. I
> suggest waiting and doing that nearer the end of stage 3 in case there
> are any fixes needed after this change.
>
> Bootstrapped and tested in various configurations on x86_64-linux and
> powerpc64-linux.
>
> Committed to trunk!
>
> Phew.
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: c++config.patch
Type: text/x-patch
Size: 589 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20141220/e6efa333/attachment.bin>


More information about the Gcc-patches mailing list