aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-tree.cc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2023-09-29 12:12:22 +0100
committerJonathan Wakely <jwakely@redhat.com>2023-10-21 11:54:00 +0100
commit405a4140fc30bce86b1ec885a98bb17704e0c8c6 (patch)
tree8cbd35d9330589d64c49ef983045c872ea563a84 /gcc/rust/backend/rust-tree.cc
parentbe34a8b538c0f04b11a428bd1a9340eb19dec13f (diff)
downloadgcc-405a4140fc30bce86b1ec885a98bb17704e0c8c6.zip
gcc-405a4140fc30bce86b1ec885a98bb17704e0c8c6.tar.gz
gcc-405a4140fc30bce86b1ec885a98bb17704e0c8c6.tar.bz2
libstdc++: Split std::basic_string::_M_use_local_data into two functions
This splits out the activate-the-union-member-for-constexpr logic from _M_use_local_data, so that it can be used separately in cases that don't need to use std::pointer_traits<pointer>::pointer_to to obtain the return value. This leaves only three uses of _M_use_local_data() which are all of the same form: __s._M_data(_M_use_local_data()); __s._M_set_length(0); We could remove _M_use_local_data() and change those three places to use a new _M_reset() function that does: _M_init_local_buf(); _M_data(_M_local_data()); _M_set_length(0); This is left for a future change. libstdc++-v3/ChangeLog: * include/bits/basic_string.h (_M_init_local_buf()): New function. (_M_use_local_data()): Use _M_init_local_buf. (basic_string(), basic_string(const Alloc&)) (basic_string(basic_string&&)) (basic_string(basic_string&&, const Alloc&)): Use _M_init_local_buf instead of _M_use_local_data(). * include/bits/basic_string.tcc (swap(basic_string&)) (_M_construct(InIter, InIter, input_iterator_tag)) (_M_construct(InIter, InIter, forward_iterator_tag)) (_M_construct(size_type, CharT), reserve()): Likewise.
Diffstat (limited to 'gcc/rust/backend/rust-tree.cc')
0 files changed, 0 insertions, 0 deletions