From: Jonathan Wakely Date: Fri, 4 Jan 2019 23:23:22 +0000 (+0000) Subject: Export explicit instantiations for C++17 members of std::string X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1a289fa36294627c252492e4c18d7877a7c80dc1;p=gcc.git 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 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 226365d6d20..993e0b6857b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,21 @@ 2019-01-04 Jonathan Wakely + * 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. + * config/abi/pre/gnu.ver (GLIBCXX_3.4.26): Export allocator-extended copy/move constructors for old std::basic_string. * include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI] diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver index 1d157288fcf..6c18caa6d8a 100644 --- a/libstdc++-v3/config/abi/pre/gnu.ver +++ b/libstdc++-v3/config/abi/pre/gnu.ver @@ -1742,7 +1742,8 @@ GLIBCXX_3.4.21 { _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]Ev; _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]I[PN]*; _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE[Daip]*; - _ZNKSt7__cxx1112basic_string*; + _ZNKSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE[1-9]*; + _ZNKSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EEixE[jmy]; # operator+ for ABI-tagged std::basic_string _ZStplI[cw]St11char_traitsI[cw]ESaI[cw]EENSt7__cxx1112basic_stringIT_T0_T1_EE*; @@ -2077,6 +2078,27 @@ GLIBCXX_3.4.26 { _ZNSbIwSt11char_traitsIwESaIwEEC[12]ERKS2_RKS1_; _ZNSbIwSt11char_traitsIwESaIwEEC[12]EOS2_RKS1_; + # basic_string::operator basic_string_view() const + _ZNKSscvSt17basic_string_viewIcSt11char_traitsIcEEEv; + _ZNKSbIwSt11char_traitsIwESaIwEEcvSt17basic_string_viewIwS0_EEv; + _ZNKSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EEcvSt17basic_string_viewI[cw]S2_EEv; + # basic_string::data() + _ZNSs4dataEv; + _ZNSbIwSt11char_traitsIwESaIwEE4dataEv; + _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE4dataEv; + # basic_string::_S_to_string_view(basic_string_view) + _ZNSs17_S_to_string_viewESt17basic_string_viewIcSt11char_traitsIcEE; + _ZNSbIwSt11char_traitsIwESaIwEE17_S_to_string_viewESt17basic_string_viewIwS0_E; + _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE17_S_to_string_viewESt17basic_string_viewI[cw]S2_E; + # basic_string::__sv_wrapper::__sv_wrapper(basic_string_view) + _ZNSs12__sv_wrapperC[12]ESt17basic_string_viewIcSt11char_traitsIcEE; + _ZNSbIwSt11char_traitsIwESaIwEE12__sv_wrapperC[12]ESt17basic_string_viewIwS0_E; + _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE12__sv_wrapperC[12]ESt17basic_string_viewI[cw]S2_E; + # basic_string::basic_string(__sv_wrapper, const allocator_type&) + _ZNSsC[12]ENSs12__sv_wrapperERKSaIcE; + _ZNSbIwSt11char_traitsIwESaIwEEC[12]ENS2_12__sv_wrapperERKS1_; + _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]ENS4_12__sv_wrapperERKS3_; + } GLIBCXX_3.4.25; # Symbols in the support library (libsupc++) have their own tag. diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index 43460df5d1f..28ed337bdb6 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -44,7 +44,7 @@ #include #endif -#if __cplusplus > 201402L +#if __cplusplus >= 201703L # include #endif @@ -109,7 +109,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 #endif private: -#if __cplusplus > 201402L +#if __cplusplus >= 201703L // A helper type for avoiding boiler-plate. typedef basic_string_view<_CharT, _Traits> __sv_type; @@ -134,6 +134,16 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 explicit __sv_wrapper(__sv_type __sv) noexcept : _M_sv(__sv) { } __sv_type _M_sv; }; + + /** + * @brief Only internally used: Construct string from a string view + * wrapper. + * @param __svw string view wrapper. + * @param __a Allocator to use. + */ + explicit + basic_string(__sv_wrapper __svw, const _Alloc& __a) + : basic_string(__svw._M_sv.data(), __svw._M_sv.size(), __a) { } #endif // Use empty-base optimization: http://www.cantrip.org/emptyopt.html @@ -617,7 +627,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 : _M_dataplus(_M_local_data(), __a) { _M_construct(__beg, __end); } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Construct string from a substring of a string_view. * @param __t Source object convertible to string view. @@ -639,16 +649,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 explicit basic_string(const _Tp& __t, const _Alloc& __a = _Alloc()) : basic_string(__sv_wrapper(_S_to_string_view(__t)), __a) { } - - /** - * @brief Only internally used: Construct string from a string view - * wrapper. - * @param __svw string view wrapper. - * @param __a Allocator to use. - */ - explicit - basic_string(__sv_wrapper __svw, const _Alloc& __a) - : basic_string(__svw._M_sv.data(), __svw._M_sv.size(), __a) { } #endif // C++17 /** @@ -799,7 +799,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 } #endif // C++11 -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Set value to string constructed from a string_view. * @param __svt An object convertible to string_view. @@ -1200,7 +1200,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 { return this->append(__l.begin(), __l.size()); } #endif // C++11 -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Append a string_view. * @param __svt An object convertible to string_view to be appended. @@ -1309,7 +1309,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 append(_InputIterator __first, _InputIterator __last) { return this->replace(end(), end(), __first, __last); } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Append a string_view. * @param __svt An object convertible to string_view to be appended. @@ -1481,7 +1481,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 { return this->assign(__l.begin(), __l.size()); } #endif // C++11 -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Set value from a string_view. * @param __svt The source object convertible to string_view. @@ -1750,7 +1750,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 return iterator(_M_data() + __pos); } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Insert a string_view. * @param __pos Iterator referencing position in string to insert at. @@ -2181,7 +2181,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 { return this->replace(__i1, __i2, __l.begin(), __l.size()); } #endif // C++11 -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Replace range of characters with string_view. * @param __pos The position to replace at. @@ -2309,7 +2309,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 data() const _GLIBCXX_NOEXCEPT { return _M_data(); } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Return non-const pointer to contents. * @@ -2359,7 +2359,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 _GLIBCXX_NOEXCEPT { return this->find(__str.data(), __pos, __str.size()); } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Find position of a string_view. * @param __svt The object convertible to string_view to locate. @@ -2421,7 +2421,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 _GLIBCXX_NOEXCEPT { return this->rfind(__str.data(), __pos, __str.size()); } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Find last position of a string_view. * @param __svt The object convertible to string_view to locate. @@ -2500,7 +2500,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 _GLIBCXX_NOEXCEPT { return this->find_first_of(__str.data(), __pos, __str.size()); } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Find position of a character of a string_view. * @param __svt An object convertible to string_view containing @@ -2584,7 +2584,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 _GLIBCXX_NOEXCEPT { return this->find_last_of(__str.data(), __pos, __str.size()); } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Find last position of a character of string. * @param __svt An object convertible to string_view containing @@ -2667,7 +2667,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 _GLIBCXX_NOEXCEPT { return this->find_first_not_of(__str.data(), __pos, __str.size()); } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Find position of a character not in a string_view. * @param __svt A object convertible to string_view containing @@ -2749,7 +2749,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 _GLIBCXX_NOEXCEPT { return this->find_last_not_of(__str.data(), __pos, __str.size()); } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Find last position of a character not in a string_view. * @param __svt An object convertible to string_view containing @@ -2859,7 +2859,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 return __r; } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Compare to a string_view. * @param __svt An object convertible to string_view to compare against. @@ -3493,7 +3493,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 _S_empty_rep() _GLIBCXX_NOEXCEPT { return _Rep::_S_empty_rep(); } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L // A helper type for avoiding boiler-plate. typedef basic_string_view<_CharT, _Traits> __sv_type; @@ -3518,6 +3518,16 @@ _GLIBCXX_END_NAMESPACE_CXX11 explicit __sv_wrapper(__sv_type __sv) noexcept : _M_sv(__sv) { } __sv_type _M_sv; }; + + /** + * @brief Only internally used: Construct string from a string view + * wrapper. + * @param __svw string view wrapper. + * @param __a Allocator to use. + */ + explicit + basic_string(__sv_wrapper __svw, const _Alloc& __a) + : basic_string(__svw._M_sv.data(), __svw._M_sv.size(), __a) { } #endif public: @@ -3662,7 +3672,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 basic_string(_InputIterator __beg, _InputIterator __end, const _Alloc& __a = _Alloc()); -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Construct string from a substring of a string_view. * @param __t Source object convertible to string view. @@ -3684,16 +3694,6 @@ _GLIBCXX_END_NAMESPACE_CXX11 explicit basic_string(const _Tp& __t, const _Alloc& __a = _Alloc()) : basic_string(__sv_wrapper(_S_to_string_view(__t)), __a) { } - - /** - * @brief Only internally used: Construct string from a string view - * wrapper. - * @param __svw string view wrapper. - * @param __a Allocator to use. - */ - explicit - basic_string(__sv_wrapper __svw, const _Alloc& __a) - : basic_string(__svw._M_sv.data(), __svw._M_sv.size(), __a) { } #endif // C++17 /** @@ -3761,7 +3761,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 } #endif // C++11 -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Set value to string constructed from a string_view. * @param __svt An object convertible to string_view. @@ -4183,7 +4183,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 { return this->append(__l.begin(), __l.size()); } #endif // C++11 -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Append a string_view. * @param __svt The object convertible to string_view to be appended. @@ -4275,7 +4275,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 append(_InputIterator __first, _InputIterator __last) { return this->replace(_M_iend(), _M_iend(), __first, __last); } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Append a string_view. * @param __svt The object convertible to string_view to be appended. @@ -4433,7 +4433,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 { return this->assign(__l.begin(), __l.size()); } #endif // C++11 -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Set value from a string_view. * @param __svt The source object convertible to string_view. @@ -4640,7 +4640,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 return iterator(_M_data() + __pos); } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Insert a string_view. * @param __pos Iterator referencing position in string to insert at. @@ -5030,7 +5030,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 { return this->replace(__i1, __i2, __l.begin(), __l.end()); } #endif // C++11 -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Replace range of characters with string_view. * @param __pos The position to replace at. @@ -5203,7 +5203,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 data() const _GLIBCXX_NOEXCEPT { return _M_data(); } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Return non-const pointer to contents. * @@ -5286,7 +5286,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 size_type find(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT; -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Find position of a string_view. * @param __svt The object convertible to string_view to locate. @@ -5364,7 +5364,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 size_type rfind(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT; -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Find last position of a string_view. * @param __svt The object convertible to string_view to locate. @@ -5447,7 +5447,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 find_first_of(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT { return this->find(__c, __pos); } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Find position of a character of a string_view. * @param __svt An object convertible to string_view containing @@ -5531,7 +5531,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 find_last_of(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT { return this->rfind(__c, __pos); } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Find last position of a character of string. * @param __svt An object convertible to string_view containing @@ -5612,7 +5612,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 find_first_not_of(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT; -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Find position of a character not in a string_view. * @param __svt An object convertible to string_view containing @@ -5694,7 +5694,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 find_last_not_of(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT; -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Find last position of a character not in a string_view. * @param __svt An object convertible to string_view containing @@ -5756,7 +5756,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 return __r; } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** * @brief Compare to a string_view. * @param __svt An object convertible to string_view to compare against. diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc index 0eaf8e64c40..314b8fe207f 100644 --- a/libstdc++-v3/include/bits/basic_string.tcc +++ b/libstdc++-v3/include/bits/basic_string.tcc @@ -1604,7 +1604,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Until those definitions are compiled as C++17 suppress the declaration, // so C++17 code will implicitly instantiate std::string and std::wstring // as needed. -# if __cplusplus <= 201402L && _GLIBCXX_EXTERN_TEMPLATE > 0 +# if __cplusplus <= 201703L && _GLIBCXX_EXTERN_TEMPLATE > 0 extern template class basic_string; # elif ! _GLIBCXX_USE_CXX11_ABI // Still need to prevent implicit instantiation of the COW empty rep, @@ -1627,7 +1627,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION getline(basic_istream&, string&); #ifdef _GLIBCXX_USE_WCHAR_T -# if __cplusplus <= 201402L && _GLIBCXX_EXTERN_TEMPLATE > 0 +# if __cplusplus <= 201703L && _GLIBCXX_EXTERN_TEMPLATE > 0 extern template class basic_string; # elif ! _GLIBCXX_USE_CXX11_ABI extern template basic_string::size_type diff --git a/libstdc++-v3/src/c++17/Makefile.am b/libstdc++-v3/src/c++17/Makefile.am index c26e5276f94..afa119eecb6 100644 --- a/libstdc++-v3/src/c++17/Makefile.am +++ b/libstdc++-v3/src/c++17/Makefile.am @@ -28,10 +28,11 @@ noinst_LTLIBRARIES = libc++17convenience.la headers = sources = \ - memory_resource.cc + memory_resource.cc \ + string-inst.cc if ENABLE_DUAL_ABI -extra_string_inst_sources = +extra_string_inst_sources = cow-string-inst.cc else extra_string_inst_sources = endif diff --git a/libstdc++-v3/src/c++17/Makefile.in b/libstdc++-v3/src/c++17/Makefile.in index 287b4b8bb69..0657bdcf9d9 100644 --- a/libstdc++-v3/src/c++17/Makefile.in +++ b/libstdc++-v3/src/c++17/Makefile.in @@ -121,8 +121,8 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libc__17convenience_la_LIBADD = -am__objects_1 = memory_resource.lo -am__objects_2 = +am__objects_1 = memory_resource.lo string-inst.lo +@ENABLE_DUAL_ABI_TRUE@am__objects_2 = cow-string-inst.lo @ENABLE_EXTERN_TEMPLATE_TRUE@am__objects_3 = $(am__objects_2) am_libc__17convenience_la_OBJECTS = $(am__objects_1) $(am__objects_3) libc__17convenience_la_OBJECTS = $(am_libc__17convenience_la_OBJECTS) @@ -411,10 +411,11 @@ AM_CPPFLAGS = $(GLIBCXX_INCLUDES) $(CPPFLAGS) noinst_LTLIBRARIES = libc++17convenience.la headers = sources = \ - memory_resource.cc + memory_resource.cc \ + string-inst.cc @ENABLE_DUAL_ABI_FALSE@extra_string_inst_sources = -@ENABLE_DUAL_ABI_TRUE@extra_string_inst_sources = +@ENABLE_DUAL_ABI_TRUE@extra_string_inst_sources = cow-string-inst.cc # XTEMPLATE_FLAGS = @ENABLE_EXTERN_TEMPLATE_FALSE@inst_sources = diff --git a/libstdc++-v3/src/c++17/cow-string-inst.cc b/libstdc++-v3/src/c++17/cow-string-inst.cc new file mode 100644 index 00000000000..b47a6e50d87 --- /dev/null +++ b/libstdc++-v3/src/c++17/cow-string-inst.cc @@ -0,0 +1,34 @@ +// Reference-counted COW string instantiations for C++17 -*- C++ -*- + +// Copyright (C) 2019 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +// +// ISO C++ 14882:2017 24 Strings library +// + +#define _GLIBCXX_USE_CXX11_ABI 0 +#include "string-inst.cc" + +#if ! _GLIBCXX_USE_DUAL_ABI +# error This file should not be compiled for this configuration. +#endif diff --git a/libstdc++-v3/src/c++17/string-inst.cc b/libstdc++-v3/src/c++17/string-inst.cc new file mode 100644 index 00000000000..c095a90587e --- /dev/null +++ b/libstdc++-v3/src/c++17/string-inst.cc @@ -0,0 +1,50 @@ +// string instantiations for C++17 -*- C++ -*- + +// Copyright (C) 2019 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +// +// ISO C++ 14882:2017 24 Strings library +// + +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +template basic_string::basic_string(__sv_wrapper, const allocator_type&); +template basic_string::__sv_wrapper::__sv_wrapper(string_view); +template string_view basic_string::_S_to_string_view(string_view); +template basic_string::operator string_view() const noexcept; +template char* basic_string::data() noexcept; + +#ifdef _GLIBCXX_USE_WCHAR_T +template basic_string::basic_string(__sv_wrapper, const allocator_type&); +template basic_string::__sv_wrapper::__sv_wrapper(wstring_view); +template wstring_view basic_string::_S_to_string_view(wstring_view); +template basic_string::operator wstring_view() const noexcept; +template wchar_t* basic_string::data() noexcept; +#endif + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace std