<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gcc.git/libstdc++-v3/testsuite/21_strings/basic_string/allocator, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/'/>
<entry>
<title>libstdc++: Fix allocator propagation for rvalue+rvalue string concatenation</title>
<updated>2025-04-29T09:52:47+00:00</updated>
<author>
<name>Jonathan Wakely</name>
<email>jwakely@redhat.com</email>
</author>
<published>2025-04-28T13:31:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=025374559b22f5d9148f227b3df800a8e0231f59'/>
<id>025374559b22f5d9148f227b3df800a8e0231f59</id>
<content type='text'>
I made a last-minute change to Nina's r10-200-gf4e678ef74b272
implementation of P1165R1 (consistent allocator propagation for
operator+ on strings), so that the rvalue+rvalue case assumes that COW
strings do not support stateful allocators. I don't think that was true
when the change went in, and isn't true now. COW strings don't support
allocator propagation on assignment and swap, but they do support
non-equal stateful allocators, which are correctly propagated on move
construction.

This removes the preprocessor conditional in the rvalue+rvalue overload
so that COW strings are handled equivalently. Also use constexpr-if
unconditionally, disabling diagnostics with pragmas.

libstdc++-v3/ChangeLog:

	* include/bits/basic_string.h (operator+(string&amp;&amp;, string&amp;&amp;)):
	Do not assume that COW strings have equal allocators. Use
	constexpr-if unconditionally.
	* testsuite/21_strings/basic_string/allocator/char/operator_plus.cc:
	Remove cxx11_abi effective-target check.
	* testsuite/21_strings/basic_string/allocator/wchar_t/operator_plus.cc:
	Likewise.

Reviewed-by: Tomasz Kamiński &lt;tkaminsk@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I made a last-minute change to Nina's r10-200-gf4e678ef74b272
implementation of P1165R1 (consistent allocator propagation for
operator+ on strings), so that the rvalue+rvalue case assumes that COW
strings do not support stateful allocators. I don't think that was true
when the change went in, and isn't true now. COW strings don't support
allocator propagation on assignment and swap, but they do support
non-equal stateful allocators, which are correctly propagated on move
construction.

This removes the preprocessor conditional in the rvalue+rvalue overload
so that COW strings are handled equivalently. Also use constexpr-if
unconditionally, disabling diagnostics with pragmas.

libstdc++-v3/ChangeLog:

	* include/bits/basic_string.h (operator+(string&amp;&amp;, string&amp;&amp;)):
	Do not assume that COW strings have equal allocators. Use
	constexpr-if unconditionally.
	* testsuite/21_strings/basic_string/allocator/char/operator_plus.cc:
	Remove cxx11_abi effective-target check.
	* testsuite/21_strings/basic_string/allocator/wchar_t/operator_plus.cc:
	Likewise.

Reviewed-by: Tomasz Kamiński &lt;tkaminsk@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright years.</title>
<updated>2025-01-02T10:59:57+00:00</updated>
<author>
<name>Jakub Jelinek</name>
<email>jakub@redhat.com</email>
</author>
<published>2025-01-02T10:59:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=6441eb6dc020faae0672ea724dfdb38c6a9bf6a1'/>
<id>6441eb6dc020faae0672ea724dfdb38c6a9bf6a1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>libstdc++: std::string move assignment should not use POCCA trait [PR116641]</title>
<updated>2024-09-10T17:22:32+00:00</updated>
<author>
<name>Jonathan Wakely</name>
<email>jwakely@redhat.com</email>
</author>
<published>2024-09-10T13:25:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=c07cf418fdde0c192e370a8d76a991cc7215e9c4'/>
<id>c07cf418fdde0c192e370a8d76a991cc7215e9c4</id>
<content type='text'>
The changes to implement LWG 2579 (r10-327-gdb33efde17932f) made
std::string::assign use the propagate_on_container_copy_assignment
(POCCA) trait, for consistency with operator=(const basic_string&amp;).
However, this also unintentionally affected operator=(basic_string&amp;&amp;)
which calls assign(str) to make a deep copy when performing a move is
not possible. The fix is for the move assignment operator to call
_M_assign(str) instead of assign(str), as this just does the deep copy
and doesn't check the POCCA trait first.

The bug only affects the unlikely/useless combination of POCCA==true and
POCMA==false, but we should fix it for correctness anyway. it should
also make move assignment slightly cheaper to compile and execute,
because we skip the extra code in assign(const basic_string&amp;).

libstdc++-v3/ChangeLog:

	PR libstdc++/116641
	* include/bits/basic_string.h (operator=(basic_string&amp;&amp;)): Call
	_M_assign instead of assign.
	* testsuite/21_strings/basic_string/allocator/116641.cc: New
	test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The changes to implement LWG 2579 (r10-327-gdb33efde17932f) made
std::string::assign use the propagate_on_container_copy_assignment
(POCCA) trait, for consistency with operator=(const basic_string&amp;).
However, this also unintentionally affected operator=(basic_string&amp;&amp;)
which calls assign(str) to make a deep copy when performing a move is
not possible. The fix is for the move assignment operator to call
_M_assign(str) instead of assign(str), as this just does the deep copy
and doesn't check the POCCA trait first.

The bug only affects the unlikely/useless combination of POCCA==true and
POCMA==false, but we should fix it for correctness anyway. it should
also make move assignment slightly cheaper to compile and execute,
because we skip the extra code in assign(const basic_string&amp;).

libstdc++-v3/ChangeLog:

	PR libstdc++/116641
	* include/bits/basic_string.h (operator=(basic_string&amp;&amp;)): Call
	_M_assign instead of assign.
	* testsuite/21_strings/basic_string/allocator/116641.cc: New
	test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright years.</title>
<updated>2024-01-03T11:19:35+00:00</updated>
<author>
<name>Jakub Jelinek</name>
<email>jakub@redhat.com</email>
</author>
<published>2024-01-03T11:19:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=a945c346f57ba40fc80c14ac59be0d43624e559d'/>
<id>a945c346f57ba40fc80c14ac59be0d43624e559d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>libstdc++: Optimize basic_string move assignment</title>
<updated>2023-02-04T13:03:54+00:00</updated>
<author>
<name>François Dumont</name>
<email>fdumont@gcc.gnu.org</email>
</author>
<published>2023-01-04T18:34:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=540a22d243966d1b882db26b17fe674467e2a169'/>
<id>540a22d243966d1b882db26b17fe674467e2a169</id>
<content type='text'>
Since resolution of Issue 2593 [1] we can consider that equal allocators
before the propagate-on-move-assignment operations will still be equal
afterward.

So we can extend the optimization of transfering the storage of the move-to
instance to the move-from one that is currently limited to always equal
allocators.

[1] https://cplusplus.github.io/LWG/issue2593

libstdc++-v3/ChangeLog:

	* include/bits/basic_string.h (operator=(basic_string&amp;&amp;)): Transfer move-to
	storage to the move-from instance when allocators are equal.
	* testsuite/21_strings/basic_string/allocator/char/move_assign.cc (test04):
	New test case.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since resolution of Issue 2593 [1] we can consider that equal allocators
before the propagate-on-move-assignment operations will still be equal
afterward.

So we can extend the optimization of transfering the storage of the move-to
instance to the move-from one that is currently limited to always equal
allocators.

[1] https://cplusplus.github.io/LWG/issue2593

libstdc++-v3/ChangeLog:

	* include/bits/basic_string.h (operator=(basic_string&amp;&amp;)): Transfer move-to
	storage to the move-from instance when allocators are equal.
	* testsuite/21_strings/basic_string/allocator/char/move_assign.cc (test04):
	New test case.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright years.</title>
<updated>2023-01-16T10:52:17+00:00</updated>
<author>
<name>Jakub Jelinek</name>
<email>jakub@redhat.com</email>
</author>
<published>2023-01-16T10:50:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=83ffe9cde7fe0b4deb0d1b54175fd9b19c38179c'/>
<id>83ffe9cde7fe0b4deb0d1b54175fd9b19c38179c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright years.</title>
<updated>2022-01-03T09:42:10+00:00</updated>
<author>
<name>Jakub Jelinek</name>
<email>jakub@redhat.com</email>
</author>
<published>2022-01-03T09:42:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=7adcbafe45f8001b698967defe682687b52c0007'/>
<id>7adcbafe45f8001b698967defe682687b52c0007</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>libstdc++: Replace hyphens in effective target keywords</title>
<updated>2021-11-24T13:20:26+00:00</updated>
<author>
<name>Jonathan Wakely</name>
<email>jwakely@redhat.com</email>
</author>
<published>2021-11-24T11:41:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=a04b73e15b7d691e4e668f2584b57f09f598d397'/>
<id>a04b73e15b7d691e4e668f2584b57f09f598d397</id>
<content type='text'>
An effective target like foo-bar-baz will match a target selector of
*-*-* and cause problems in the testsuite. Several libstdc++ et keywords
are of the form foo-bar, which could still be a problem for *-*
selectors.

Replace hyphens with underscores in the et keywords "debug-mode",
"cxx11-abi", etc.

libstdc++-v3/ChangeLog:

	* testsuite/lib/libstdc++.exp: Rename effective target keywords
	to avoid dashes in the name.
	* testsuite/*: Update effective targe keywords.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
An effective target like foo-bar-baz will match a target selector of
*-*-* and cause problems in the testsuite. Several libstdc++ et keywords
are of the form foo-bar, which could still be a problem for *-*
selectors.

Replace hyphens with underscores in the et keywords "debug-mode",
"cxx11-abi", etc.

libstdc++-v3/ChangeLog:

	* testsuite/lib/libstdc++.exp: Rename effective target keywords
	to avoid dashes in the name.
	* testsuite/*: Update effective targe keywords.
</pre>
</div>
</content>
</entry>
<entry>
<title>libstdc++: Fix typos in tests</title>
<updated>2021-11-16T14:08:42+00:00</updated>
<author>
<name>Jonathan Wakely</name>
<email>jwakely@redhat.com</email>
</author>
<published>2021-11-15T20:37:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=971976947154c7442a2f8262a9bbd1bc540e6544'/>
<id>971976947154c7442a2f8262a9bbd1bc540e6544</id>
<content type='text'>
libstdc++-v3/ChangeLog:

	* testsuite/21_strings/basic_string/allocator/71964.cc: Fix
	typo.
	* testsuite/23_containers/set/allocator/71964.cc: Likewise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
libstdc++-v3/ChangeLog:

	* testsuite/21_strings/basic_string/allocator/71964.cc: Fix
	typo.
	* testsuite/23_containers/set/allocator/71964.cc: Likewise.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright years.</title>
<updated>2021-01-04T09:26:59+00:00</updated>
<author>
<name>Jakub Jelinek</name>
<email>jakub@redhat.com</email>
</author>
<published>2021-01-04T09:26:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=99dee82307f1e163e150c9c810452979994047ce'/>
<id>99dee82307f1e163e150c9c810452979994047ce</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
