mirror of git://gcc.gnu.org/git/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
This commit is contained in:
parent
4ff3e65090
commit
1a289fa362
|
|
@ -1,5 +1,21 @@
|
||||||
2019-01-04 Jonathan Wakely <jwakely@redhat.com>
|
2019-01-04 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
|
* 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
|
* config/abi/pre/gnu.ver (GLIBCXX_3.4.26): Export allocator-extended
|
||||||
copy/move constructors for old std::basic_string.
|
copy/move constructors for old std::basic_string.
|
||||||
* include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI]
|
* include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI]
|
||||||
|
|
|
||||||
|
|
@ -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]Ev;
|
||||||
_ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]I[PN]*;
|
_ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EEC[12]I[PN]*;
|
||||||
_ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE[Daip]*;
|
_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
|
# operator+ for ABI-tagged std::basic_string
|
||||||
_ZStplI[cw]St11char_traitsI[cw]ESaI[cw]EENSt7__cxx1112basic_stringIT_T0_T1_EE*;
|
_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]ERKS2_RKS1_;
|
||||||
_ZNSbIwSt11char_traitsIwESaIwEEC[12]EOS2_RKS1_;
|
_ZNSbIwSt11char_traitsIwESaIwEEC[12]EOS2_RKS1_;
|
||||||
|
|
||||||
|
# basic_string<C, T, A>::operator basic_string_view<C, T>() 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<C, T, A>::data()
|
||||||
|
_ZNSs4dataEv;
|
||||||
|
_ZNSbIwSt11char_traitsIwESaIwEE4dataEv;
|
||||||
|
_ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE4dataEv;
|
||||||
|
# basic_string<C, T, A>::_S_to_string_view(basic_string_view<C, T>)
|
||||||
|
_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<C, T, A>::__sv_wrapper::__sv_wrapper(basic_string_view<C, T>)
|
||||||
|
_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<C, T, A>::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;
|
} GLIBCXX_3.4.25;
|
||||||
|
|
||||||
# Symbols in the support library (libsupc++) have their own tag.
|
# Symbols in the support library (libsupc++) have their own tag.
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
# include <string_view>
|
# include <string_view>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -109,7 +109,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
// A helper type for avoiding boiler-plate.
|
// A helper type for avoiding boiler-plate.
|
||||||
typedef basic_string_view<_CharT, _Traits> __sv_type;
|
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) { }
|
explicit __sv_wrapper(__sv_type __sv) noexcept : _M_sv(__sv) { }
|
||||||
__sv_type _M_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
|
#endif
|
||||||
|
|
||||||
// Use empty-base optimization: http://www.cantrip.org/emptyopt.html
|
// 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_dataplus(_M_local_data(), __a)
|
||||||
{ _M_construct(__beg, __end); }
|
{ _M_construct(__beg, __end); }
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Construct string from a substring of a string_view.
|
* @brief Construct string from a substring of a string_view.
|
||||||
* @param __t Source object convertible to string view.
|
* @param __t Source object convertible to string view.
|
||||||
|
|
@ -639,16 +649,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
|
||||||
explicit
|
explicit
|
||||||
basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
|
basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
|
||||||
: basic_string(__sv_wrapper(_S_to_string_view(__t)), __a) { }
|
: 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
|
#endif // C++17
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -799,7 +799,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
|
||||||
}
|
}
|
||||||
#endif // C++11
|
#endif // C++11
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Set value to string constructed from a string_view.
|
* @brief Set value to string constructed from a string_view.
|
||||||
* @param __svt An object convertible to 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()); }
|
{ return this->append(__l.begin(), __l.size()); }
|
||||||
#endif // C++11
|
#endif // C++11
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Append a string_view.
|
* @brief Append a string_view.
|
||||||
* @param __svt An object convertible to string_view to be appended.
|
* @param __svt An object convertible to string_view to be appended.
|
||||||
|
|
@ -1309,7 +1309,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
|
||||||
append(_InputIterator __first, _InputIterator __last)
|
append(_InputIterator __first, _InputIterator __last)
|
||||||
{ return this->replace(end(), end(), __first, __last); }
|
{ return this->replace(end(), end(), __first, __last); }
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Append a string_view.
|
* @brief Append a string_view.
|
||||||
* @param __svt An object convertible to string_view to be appended.
|
* @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()); }
|
{ return this->assign(__l.begin(), __l.size()); }
|
||||||
#endif // C++11
|
#endif // C++11
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Set value from a string_view.
|
* @brief Set value from a string_view.
|
||||||
* @param __svt The source object convertible to string_view.
|
* @param __svt The source object convertible to string_view.
|
||||||
|
|
@ -1750,7 +1750,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
|
||||||
return iterator(_M_data() + __pos);
|
return iterator(_M_data() + __pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Insert a string_view.
|
* @brief Insert a string_view.
|
||||||
* @param __pos Iterator referencing position in string to insert at.
|
* @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()); }
|
{ return this->replace(__i1, __i2, __l.begin(), __l.size()); }
|
||||||
#endif // C++11
|
#endif // C++11
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Replace range of characters with string_view.
|
* @brief Replace range of characters with string_view.
|
||||||
* @param __pos The position to replace at.
|
* @param __pos The position to replace at.
|
||||||
|
|
@ -2309,7 +2309,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
|
||||||
data() const _GLIBCXX_NOEXCEPT
|
data() const _GLIBCXX_NOEXCEPT
|
||||||
{ return _M_data(); }
|
{ return _M_data(); }
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Return non-const pointer to contents.
|
* @brief Return non-const pointer to contents.
|
||||||
*
|
*
|
||||||
|
|
@ -2359,7 +2359,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
|
||||||
_GLIBCXX_NOEXCEPT
|
_GLIBCXX_NOEXCEPT
|
||||||
{ return this->find(__str.data(), __pos, __str.size()); }
|
{ return this->find(__str.data(), __pos, __str.size()); }
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Find position of a string_view.
|
* @brief Find position of a string_view.
|
||||||
* @param __svt The object convertible to string_view to locate.
|
* @param __svt The object convertible to string_view to locate.
|
||||||
|
|
@ -2421,7 +2421,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
|
||||||
_GLIBCXX_NOEXCEPT
|
_GLIBCXX_NOEXCEPT
|
||||||
{ return this->rfind(__str.data(), __pos, __str.size()); }
|
{ return this->rfind(__str.data(), __pos, __str.size()); }
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Find last position of a string_view.
|
* @brief Find last position of a string_view.
|
||||||
* @param __svt The object convertible to string_view to locate.
|
* @param __svt The object convertible to string_view to locate.
|
||||||
|
|
@ -2500,7 +2500,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
|
||||||
_GLIBCXX_NOEXCEPT
|
_GLIBCXX_NOEXCEPT
|
||||||
{ return this->find_first_of(__str.data(), __pos, __str.size()); }
|
{ 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.
|
* @brief Find position of a character of a string_view.
|
||||||
* @param __svt An object convertible to string_view containing
|
* @param __svt An object convertible to string_view containing
|
||||||
|
|
@ -2584,7 +2584,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
|
||||||
_GLIBCXX_NOEXCEPT
|
_GLIBCXX_NOEXCEPT
|
||||||
{ return this->find_last_of(__str.data(), __pos, __str.size()); }
|
{ 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.
|
* @brief Find last position of a character of string.
|
||||||
* @param __svt An object convertible to string_view containing
|
* @param __svt An object convertible to string_view containing
|
||||||
|
|
@ -2667,7 +2667,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
|
||||||
_GLIBCXX_NOEXCEPT
|
_GLIBCXX_NOEXCEPT
|
||||||
{ return this->find_first_not_of(__str.data(), __pos, __str.size()); }
|
{ 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.
|
* @brief Find position of a character not in a string_view.
|
||||||
* @param __svt A object convertible to string_view containing
|
* @param __svt A object convertible to string_view containing
|
||||||
|
|
@ -2749,7 +2749,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
|
||||||
_GLIBCXX_NOEXCEPT
|
_GLIBCXX_NOEXCEPT
|
||||||
{ return this->find_last_not_of(__str.data(), __pos, __str.size()); }
|
{ 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.
|
* @brief Find last position of a character not in a string_view.
|
||||||
* @param __svt An object convertible to string_view containing
|
* @param __svt An object convertible to string_view containing
|
||||||
|
|
@ -2859,7 +2859,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
|
||||||
return __r;
|
return __r;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Compare to a string_view.
|
* @brief Compare to a string_view.
|
||||||
* @param __svt An object convertible to string_view to compare against.
|
* @param __svt An object convertible to string_view to compare against.
|
||||||
|
|
@ -3493,7 +3493,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
|
||||||
_S_empty_rep() _GLIBCXX_NOEXCEPT
|
_S_empty_rep() _GLIBCXX_NOEXCEPT
|
||||||
{ return _Rep::_S_empty_rep(); }
|
{ return _Rep::_S_empty_rep(); }
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
// A helper type for avoiding boiler-plate.
|
// A helper type for avoiding boiler-plate.
|
||||||
typedef basic_string_view<_CharT, _Traits> __sv_type;
|
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) { }
|
explicit __sv_wrapper(__sv_type __sv) noexcept : _M_sv(__sv) { }
|
||||||
__sv_type _M_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
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -3662,7 +3672,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
|
||||||
basic_string(_InputIterator __beg, _InputIterator __end,
|
basic_string(_InputIterator __beg, _InputIterator __end,
|
||||||
const _Alloc& __a = _Alloc());
|
const _Alloc& __a = _Alloc());
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Construct string from a substring of a string_view.
|
* @brief Construct string from a substring of a string_view.
|
||||||
* @param __t Source object convertible to string view.
|
* @param __t Source object convertible to string view.
|
||||||
|
|
@ -3684,16 +3694,6 @@ _GLIBCXX_END_NAMESPACE_CXX11
|
||||||
explicit
|
explicit
|
||||||
basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
|
basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
|
||||||
: basic_string(__sv_wrapper(_S_to_string_view(__t)), __a) { }
|
: 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
|
#endif // C++17
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -3761,7 +3761,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
|
||||||
}
|
}
|
||||||
#endif // C++11
|
#endif // C++11
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Set value to string constructed from a string_view.
|
* @brief Set value to string constructed from a string_view.
|
||||||
* @param __svt An object convertible to 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()); }
|
{ return this->append(__l.begin(), __l.size()); }
|
||||||
#endif // C++11
|
#endif // C++11
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Append a string_view.
|
* @brief Append a string_view.
|
||||||
* @param __svt The object convertible to string_view to be appended.
|
* @param __svt The object convertible to string_view to be appended.
|
||||||
|
|
@ -4275,7 +4275,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
|
||||||
append(_InputIterator __first, _InputIterator __last)
|
append(_InputIterator __first, _InputIterator __last)
|
||||||
{ return this->replace(_M_iend(), _M_iend(), __first, __last); }
|
{ return this->replace(_M_iend(), _M_iend(), __first, __last); }
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Append a string_view.
|
* @brief Append a string_view.
|
||||||
* @param __svt The object convertible to string_view to be appended.
|
* @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()); }
|
{ return this->assign(__l.begin(), __l.size()); }
|
||||||
#endif // C++11
|
#endif // C++11
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Set value from a string_view.
|
* @brief Set value from a string_view.
|
||||||
* @param __svt The source object convertible to string_view.
|
* @param __svt The source object convertible to string_view.
|
||||||
|
|
@ -4640,7 +4640,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
|
||||||
return iterator(_M_data() + __pos);
|
return iterator(_M_data() + __pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Insert a string_view.
|
* @brief Insert a string_view.
|
||||||
* @param __pos Iterator referencing position in string to insert at.
|
* @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()); }
|
{ return this->replace(__i1, __i2, __l.begin(), __l.end()); }
|
||||||
#endif // C++11
|
#endif // C++11
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Replace range of characters with string_view.
|
* @brief Replace range of characters with string_view.
|
||||||
* @param __pos The position to replace at.
|
* @param __pos The position to replace at.
|
||||||
|
|
@ -5203,7 +5203,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
|
||||||
data() const _GLIBCXX_NOEXCEPT
|
data() const _GLIBCXX_NOEXCEPT
|
||||||
{ return _M_data(); }
|
{ return _M_data(); }
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Return non-const pointer to contents.
|
* @brief Return non-const pointer to contents.
|
||||||
*
|
*
|
||||||
|
|
@ -5286,7 +5286,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
|
||||||
size_type
|
size_type
|
||||||
find(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT;
|
find(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT;
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Find position of a string_view.
|
* @brief Find position of a string_view.
|
||||||
* @param __svt The object convertible to string_view to locate.
|
* @param __svt The object convertible to string_view to locate.
|
||||||
|
|
@ -5364,7 +5364,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
|
||||||
size_type
|
size_type
|
||||||
rfind(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT;
|
rfind(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT;
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Find last position of a string_view.
|
* @brief Find last position of a string_view.
|
||||||
* @param __svt The object convertible to string_view to locate.
|
* @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
|
find_first_of(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT
|
||||||
{ return this->find(__c, __pos); }
|
{ return this->find(__c, __pos); }
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Find position of a character of a string_view.
|
* @brief Find position of a character of a string_view.
|
||||||
* @param __svt An object convertible to string_view containing
|
* @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
|
find_last_of(_CharT __c, size_type __pos = npos) const _GLIBCXX_NOEXCEPT
|
||||||
{ return this->rfind(__c, __pos); }
|
{ return this->rfind(__c, __pos); }
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Find last position of a character of string.
|
* @brief Find last position of a character of string.
|
||||||
* @param __svt An object convertible to string_view containing
|
* @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
|
find_first_not_of(_CharT __c, size_type __pos = 0) const
|
||||||
_GLIBCXX_NOEXCEPT;
|
_GLIBCXX_NOEXCEPT;
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Find position of a character not in a string_view.
|
* @brief Find position of a character not in a string_view.
|
||||||
* @param __svt An object convertible to string_view containing
|
* @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
|
find_last_not_of(_CharT __c, size_type __pos = npos) const
|
||||||
_GLIBCXX_NOEXCEPT;
|
_GLIBCXX_NOEXCEPT;
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Find last position of a character not in a string_view.
|
* @brief Find last position of a character not in a string_view.
|
||||||
* @param __svt An object convertible to string_view containing
|
* @param __svt An object convertible to string_view containing
|
||||||
|
|
@ -5756,7 +5756,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
|
||||||
return __r;
|
return __r;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
/**
|
/**
|
||||||
* @brief Compare to a string_view.
|
* @brief Compare to a string_view.
|
||||||
* @param __svt An object convertible to string_view to compare against.
|
* @param __svt An object convertible to string_view to compare against.
|
||||||
|
|
|
||||||
|
|
@ -1604,7 +1604,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
// Until those definitions are compiled as C++17 suppress the declaration,
|
// Until those definitions are compiled as C++17 suppress the declaration,
|
||||||
// so C++17 code will implicitly instantiate std::string and std::wstring
|
// so C++17 code will implicitly instantiate std::string and std::wstring
|
||||||
// as needed.
|
// as needed.
|
||||||
# if __cplusplus <= 201402L && _GLIBCXX_EXTERN_TEMPLATE > 0
|
# if __cplusplus <= 201703L && _GLIBCXX_EXTERN_TEMPLATE > 0
|
||||||
extern template class basic_string<char>;
|
extern template class basic_string<char>;
|
||||||
# elif ! _GLIBCXX_USE_CXX11_ABI
|
# elif ! _GLIBCXX_USE_CXX11_ABI
|
||||||
// Still need to prevent implicit instantiation of the COW empty rep,
|
// Still need to prevent implicit instantiation of the COW empty rep,
|
||||||
|
|
@ -1627,7 +1627,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
getline(basic_istream<char>&, string&);
|
getline(basic_istream<char>&, string&);
|
||||||
|
|
||||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||||
# if __cplusplus <= 201402L && _GLIBCXX_EXTERN_TEMPLATE > 0
|
# if __cplusplus <= 201703L && _GLIBCXX_EXTERN_TEMPLATE > 0
|
||||||
extern template class basic_string<wchar_t>;
|
extern template class basic_string<wchar_t>;
|
||||||
# elif ! _GLIBCXX_USE_CXX11_ABI
|
# elif ! _GLIBCXX_USE_CXX11_ABI
|
||||||
extern template basic_string<wchar_t>::size_type
|
extern template basic_string<wchar_t>::size_type
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,11 @@ noinst_LTLIBRARIES = libc++17convenience.la
|
||||||
headers =
|
headers =
|
||||||
|
|
||||||
sources = \
|
sources = \
|
||||||
memory_resource.cc
|
memory_resource.cc \
|
||||||
|
string-inst.cc
|
||||||
|
|
||||||
if ENABLE_DUAL_ABI
|
if ENABLE_DUAL_ABI
|
||||||
extra_string_inst_sources =
|
extra_string_inst_sources = cow-string-inst.cc
|
||||||
else
|
else
|
||||||
extra_string_inst_sources =
|
extra_string_inst_sources =
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -121,8 +121,8 @@ CONFIG_CLEAN_FILES =
|
||||||
CONFIG_CLEAN_VPATH_FILES =
|
CONFIG_CLEAN_VPATH_FILES =
|
||||||
LTLIBRARIES = $(noinst_LTLIBRARIES)
|
LTLIBRARIES = $(noinst_LTLIBRARIES)
|
||||||
libc__17convenience_la_LIBADD =
|
libc__17convenience_la_LIBADD =
|
||||||
am__objects_1 = memory_resource.lo
|
am__objects_1 = memory_resource.lo string-inst.lo
|
||||||
am__objects_2 =
|
@ENABLE_DUAL_ABI_TRUE@am__objects_2 = cow-string-inst.lo
|
||||||
@ENABLE_EXTERN_TEMPLATE_TRUE@am__objects_3 = $(am__objects_2)
|
@ENABLE_EXTERN_TEMPLATE_TRUE@am__objects_3 = $(am__objects_2)
|
||||||
am_libc__17convenience_la_OBJECTS = $(am__objects_1) $(am__objects_3)
|
am_libc__17convenience_la_OBJECTS = $(am__objects_1) $(am__objects_3)
|
||||||
libc__17convenience_la_OBJECTS = $(am_libc__17convenience_la_OBJECTS)
|
libc__17convenience_la_OBJECTS = $(am_libc__17convenience_la_OBJECTS)
|
||||||
|
|
@ -411,10 +411,11 @@ AM_CPPFLAGS = $(GLIBCXX_INCLUDES) $(CPPFLAGS)
|
||||||
noinst_LTLIBRARIES = libc++17convenience.la
|
noinst_LTLIBRARIES = libc++17convenience.la
|
||||||
headers =
|
headers =
|
||||||
sources = \
|
sources = \
|
||||||
memory_resource.cc
|
memory_resource.cc \
|
||||||
|
string-inst.cc
|
||||||
|
|
||||||
@ENABLE_DUAL_ABI_FALSE@extra_string_inst_sources =
|
@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 =
|
# XTEMPLATE_FLAGS =
|
||||||
@ENABLE_EXTERN_TEMPLATE_FALSE@inst_sources =
|
@ENABLE_EXTERN_TEMPLATE_FALSE@inst_sources =
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
//
|
||||||
|
// 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
|
||||||
|
|
@ -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
|
||||||
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
//
|
||||||
|
// ISO C++ 14882:2017 24 Strings library
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace std _GLIBCXX_VISIBILITY(default)
|
||||||
|
{
|
||||||
|
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
|
|
||||||
|
template basic_string<char>::basic_string(__sv_wrapper, const allocator_type&);
|
||||||
|
template basic_string<char>::__sv_wrapper::__sv_wrapper(string_view);
|
||||||
|
template string_view basic_string<char>::_S_to_string_view(string_view);
|
||||||
|
template basic_string<char>::operator string_view() const noexcept;
|
||||||
|
template char* basic_string<char>::data() noexcept;
|
||||||
|
|
||||||
|
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||||
|
template basic_string<wchar_t>::basic_string(__sv_wrapper, const allocator_type&);
|
||||||
|
template basic_string<wchar_t>::__sv_wrapper::__sv_wrapper(wstring_view);
|
||||||
|
template wstring_view basic_string<wchar_t>::_S_to_string_view(wstring_view);
|
||||||
|
template basic_string<wchar_t>::operator wstring_view() const noexcept;
|
||||||
|
template wchar_t* basic_string<wchar_t>::data() noexcept;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
_GLIBCXX_END_NAMESPACE_VERSION
|
||||||
|
} // namespace std
|
||||||
Loading…
Reference in New Issue