]> git.ipfire.org Git - thirdparty/gcc.git/commit - libstdc++-v3/src/c++17/cow-string-inst.cc
Export explicit instantiations for C++17 members of std::string
authorJonathan Wakely <jwakely@redhat.com>
Fri, 4 Jan 2019 23:23:22 +0000 (23:23 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 4 Jan 2019 23:23:22 +0000 (23:23 +0000)
commit1a289fa36294627c252492e4c18d7877a7c80dc1
treef72c48461f5498b0faba69361a2a52347cb032dd
parent4ff3e6509066e2832fdfe9987e7fd2f8719da93f
Export explicit instantiations for C++17 members of std::string

The C++17 standard added some new members to std::basic_string, which
were not previously instantiated in the library. This meant that the
extern template declarations had to be disabled for C++17 mode. With
this patch the new members are instantiated in the library and so the
explicit instantiation declarations can be used for C++17.

The new members added by C++2a are still not exported, and so the
explicit instantiation declarations are still disabled for C++2a.

* config/abi/pre/gnu.ver (GLIBCXX_3.4.21): Make patterns less greedy
for const member functions of std::basic_string.
(GLIBCXX_3.4.26): Export member functions of std::basic_string added
in C++17.
* include/bits/basic_string.h (basic_string(__sv_wrapper, const A&)):
Make non-standard constructor private.
[!_GLIBCXX_USE_CXX11_ABI] (basic_string(__sv_wrapper, const A&)):
Likewise.
* include/bits/basic_string.tcc (std::string, std::wstring): Declare
explicit instantiations for C++17 as well as earlier dialects.
* src/c++17/Makefile.am: Add new source files.
* src/c++17/Makefile.in: Regenerate.
* src/c++17/cow-string-inst.cc: New file defining explicit
instantiations for basic_string member functions added in C++17.
* src/c++17/string-inst.cc: Likewise.

From-SVN: r267585
libstdc++-v3/ChangeLog
libstdc++-v3/config/abi/pre/gnu.ver
libstdc++-v3/include/bits/basic_string.h
libstdc++-v3/include/bits/basic_string.tcc
libstdc++-v3/src/c++17/Makefile.am
libstdc++-v3/src/c++17/Makefile.in
libstdc++-v3/src/c++17/cow-string-inst.cc [new file with mode: 0644]
libstdc++-v3/src/c++17/string-inst.cc [new file with mode: 0644]