2019-04-26 Jonathan Wakely <jwakely@redhat.com>
+ * config/abi/pre/gnu.ver (GLIBCXX_3.4): Replace wildcard that matches
+ wstring::_M_replace_dispatch with more specific patterns.
+ * include/bits/fs_path.h (path::_S_convert_loc<_InputIterator>):
+ Create const std::string to avoid redundant call to _S_convert_loc
+ with non-const pointers.
+ * include/bits/locale_conv.h (__do_str_codecvt): Use if-constexpr to
+ avoid unnecessary basic_string::assign instantiations.
+
* include/std/memory (__uses_alloc_args): Add string-literal to
static_assert, to match the one in __uses_alloc.
[__cpp_concepts] (_Std_pair): Use C++2a syntax for concept.
_ZNSbIwSt11char_traitsIwESaIwEE12_S_constructE[jmy]wRKS1_;
_ZNSbIwSt11char_traitsIwESaIwEE12_S_empty_repEv;
_ZNSbIwSt11char_traitsIwESaIwEE13_S_copy_chars*;
- _ZNSbIwSt11char_traitsIwESaIwEE[0-9][0-9]_M_replace*;
+ _ZNSbIwSt11char_traitsIwESaIwEE14_M_replace_aux*;
+ _ZNSbIwSt11char_traitsIwESaIwEE15_M_replace_safe*;
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep10_M_destroy*;
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep10_M_dispose*;
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep10_M_refcopyEv;
_S_convert_loc(_InputIterator __src, __null_terminated,
const std::locale& __loc)
{
- std::string __s = _S_string_from_iter(__src);
+ const std::string __s = _S_string_from_iter(__src);
return _S_convert_loc(__s.data(), __s.data() + __s.size(), __loc);
}
if (__result == codecvt_base::noconv)
{
- __outstr.assign(__first, __last);
- __count = __last - __first;
+ // The codecvt facet will only return noconv when the types are
+ // the same, so avoid instantiating basic_string::assign otherwise
+ if _GLIBCXX17_CONSTEXPR (is_same<typename _Codecvt::intern_type,
+ typename _Codecvt::extern_type>())
+ {
+ __outstr.assign(__first, __last);
+ __count = __last - __first;
+ }
}
else
{