<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gcc.git/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/constexpr.cc, 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 constexpr basic_string union member [PR113294]</title>
<updated>2024-02-12T23:18:04+00:00</updated>
<author>
<name>Paul Keir</name>
<email>paul.keir@uws.ac.uk</email>
</author>
<published>2024-02-12T18:15:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=065dddc6e07a917c57c7955db13b1fe77abbcabc'/>
<id>065dddc6e07a917c57c7955db13b1fe77abbcabc</id>
<content type='text'>
A call to `basic_string::clear()` in the std::string move assignment
operator leads to a constexpr error from an access of inactive union
member `_M_local_buf` in the added test (`test_move()`). Changing
`__str._M_local_buf` to `__str._M_use_local_data()` in
`operator=(basic_string&amp;&amp; __str)` fixes this.

	PR libstdc++/113294

libstdc++-v3/ChangeLog:

	* include/bits/basic_string.h (basic_string::operator=): Use
	_M_use_local_data() instead of _M_local_buf on the moved-from
	string.
	* testsuite/21_strings/basic_string/modifiers/constexpr.cc
	(test_move): New test.

Signed-off-by: Paul Keir &lt;paul.keir@uws.ac.uk&gt;
Reviewed-by: Patrick Palka &lt;ppalka@redhat.com&gt;
Reviewed-by: Jonathan Wakely &lt;jwakely@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A call to `basic_string::clear()` in the std::string move assignment
operator leads to a constexpr error from an access of inactive union
member `_M_local_buf` in the added test (`test_move()`). Changing
`__str._M_local_buf` to `__str._M_use_local_data()` in
`operator=(basic_string&amp;&amp; __str)` fixes this.

	PR libstdc++/113294

libstdc++-v3/ChangeLog:

	* include/bits/basic_string.h (basic_string::operator=): Use
	_M_use_local_data() instead of _M_local_buf on the moved-from
	string.
	* testsuite/21_strings/basic_string/modifiers/constexpr.cc
	(test_move): New test.

Signed-off-by: Paul Keir &lt;paul.keir@uws.ac.uk&gt;
Reviewed-by: Patrick Palka &lt;ppalka@redhat.com&gt;
Reviewed-by: Jonathan Wakely &lt;jwakely@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libstdc++: Remove dg-options "-std=gnu++20" from 21_strings tests</title>
<updated>2023-09-15T23:10:45+00:00</updated>
<author>
<name>Jonathan Wakely</name>
<email>jwakely@redhat.com</email>
</author>
<published>2023-09-15T13:27:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=d8c446a147efe9f25247e2726caec1f52e61b4d3'/>
<id>d8c446a147efe9f25247e2726caec1f52e61b4d3</id>
<content type='text'>
The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

	* testsuite/21_strings/basic_string/cons/char/105995.cc: Remove
	dg-options -std=gnu++20.
	* testsuite/21_strings/basic_string/cons/char/constexpr.cc:
	Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/constexpr.cc:
	Likewise.
	* testsuite/21_strings/basic_string/erasure.cc: Likewise.
	* testsuite/21_strings/basic_string/hash/hash_char8_t.cc:
	Likewise.
	* testsuite/21_strings/basic_string/literals/constexpr.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/constexpr.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/swap/constexpr-wchar_t.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/swap/constexpr.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/ends_with/char.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/ends_with/nonnull.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/ends_with/wchar_t.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/starts_with/char.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/starts_with/nonnull.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/starts_with/wchar_t.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operators/char/cmp_c++20.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operators/wchar_t/cmp_c++20.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/cons/char/range.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/copy/char/constexpr.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/copy/wchar_t/constexpr.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/ends_with/char.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/ends_with/nonnull.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/ends_with/wchar_t.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/starts_with/char.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/starts_with/nonnull.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/starts_with/wchar_t.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operators/char/cmp_c++20.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operators/wchar_t/cmp_c++20.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/requirements/constexpr_iter.cc:
	Likewise.
	* testsuite/21_strings/char_traits/requirements/constexpr_functions_c++20.cc:
	Likewise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

	* testsuite/21_strings/basic_string/cons/char/105995.cc: Remove
	dg-options -std=gnu++20.
	* testsuite/21_strings/basic_string/cons/char/constexpr.cc:
	Likewise.
	* testsuite/21_strings/basic_string/cons/wchar_t/constexpr.cc:
	Likewise.
	* testsuite/21_strings/basic_string/erasure.cc: Likewise.
	* testsuite/21_strings/basic_string/hash/hash_char8_t.cc:
	Likewise.
	* testsuite/21_strings/basic_string/literals/constexpr.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/constexpr.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/swap/constexpr-wchar_t.cc:
	Likewise.
	* testsuite/21_strings/basic_string/modifiers/swap/constexpr.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/ends_with/char.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/ends_with/nonnull.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/ends_with/wchar_t.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/starts_with/char.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/starts_with/nonnull.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/starts_with/wchar_t.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operators/char/cmp_c++20.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operators/wchar_t/cmp_c++20.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/cons/char/range.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/copy/char/constexpr.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/copy/wchar_t/constexpr.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/ends_with/char.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/ends_with/nonnull.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/ends_with/wchar_t.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/starts_with/char.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/starts_with/nonnull.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operations/starts_with/wchar_t.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operators/char/cmp_c++20.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/operators/wchar_t/cmp_c++20.cc:
	Likewise.
	* testsuite/21_strings/basic_string_view/requirements/constexpr_iter.cc:
	Likewise.
	* testsuite/21_strings/char_traits/requirements/constexpr_functions_c++20.cc:
	Likewise.
</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 tests for constexpr std::string</title>
<updated>2021-11-16T22:48:15+00:00</updated>
<author>
<name>Jonathan Wakely</name>
<email>jwakely@redhat.com</email>
</author>
<published>2021-11-16T21:00:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=73e4d9f1751fd6d3c182988b2f9d0199c86053c9'/>
<id>73e4d9f1751fd6d3c182988b2f9d0199c86053c9</id>
<content type='text'>
Some tests fail when run with -D_GLIBCXX_USE_CXX11_ABI or -stdgnu++20.

libstdc++-v3/ChangeLog:

	* include/bits/basic_string.h (operator&lt;=&gt;): Use constexpr
	unconditionally.
	* testsuite/21_strings/basic_string/modifiers/constexpr.cc:
	Require cxx11-abit effective target.
	* testsuite/21_strings/headers/string/synopsis.cc: Add
	conditional constexpr to declarations, and adjust relational
	operators for C++20.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some tests fail when run with -D_GLIBCXX_USE_CXX11_ABI or -stdgnu++20.

libstdc++-v3/ChangeLog:

	* include/bits/basic_string.h (operator&lt;=&gt;): Use constexpr
	unconditionally.
	* testsuite/21_strings/basic_string/modifiers/constexpr.cc:
	Require cxx11-abit effective target.
	* testsuite/21_strings/headers/string/synopsis.cc: Add
	conditional constexpr to declarations, and adjust relational
	operators for C++20.
</pre>
</div>
</content>
</entry>
<entry>
<title>libstdc++: Implement constexpr std::basic_string for C++20</title>
<updated>2021-11-16T16:43:20+00:00</updated>
<author>
<name>Michael de Lang</name>
<email>kingoipo@gmail.com</email>
</author>
<published>2020-02-26T22:43:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=b96e2ff9d8c56bad68b5dd10e3a601f12496ae36'/>
<id>b96e2ff9d8c56bad68b5dd10e3a601f12496ae36</id>
<content type='text'>
This is only supported for the cxx11 ABI, not for COW strings.

libstdc++-v3/ChangeLog:

	* include/bits/basic_string.h (basic_string, operator""s): Add
	constexpr for C++20.
	(basic_string::basic_string(basic_string&amp;&amp;)): Only copy
	initialized portion of the buffer.
	(basic_string::basic_string(basic_string&amp;&amp;, const Alloc&amp;)):
	Likewise.
	* include/bits/basic_string.tcc (basic_string): Add constexpr
	for C++20.
	(basic_string::swap(basic_string&amp;)): Only copy initialized
	portions of the buffers.
	(basic_string::_M_replace): Add constexpr implementation that
	doesn't depend on pointer comparisons.
	* include/bits/cow_string.h: Adjust comment.
	* include/ext/type_traits.h (__is_null_pointer): Add constexpr.
	* include/std/string (erase, erase_if): Add constexpr.
	* include/std/version (__cpp_lib_constexpr_string): Update
	value.
	* testsuite/21_strings/basic_string/cons/char/constexpr.cc:
	New test.
	* testsuite/21_strings/basic_string/cons/wchar_t/constexpr.cc:
	New test.
	* testsuite/21_strings/basic_string/literals/constexpr.cc:
	New test.
	* testsuite/21_strings/basic_string/modifiers/constexpr.cc: New test.
	* testsuite/21_strings/basic_string/modifiers/swap/char/constexpr.cc:
	New test.
	* testsuite/21_strings/basic_string/modifiers/swap/wchar_t/constexpr.cc:
	New test.
	* testsuite/21_strings/basic_string/version.cc: New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is only supported for the cxx11 ABI, not for COW strings.

libstdc++-v3/ChangeLog:

	* include/bits/basic_string.h (basic_string, operator""s): Add
	constexpr for C++20.
	(basic_string::basic_string(basic_string&amp;&amp;)): Only copy
	initialized portion of the buffer.
	(basic_string::basic_string(basic_string&amp;&amp;, const Alloc&amp;)):
	Likewise.
	* include/bits/basic_string.tcc (basic_string): Add constexpr
	for C++20.
	(basic_string::swap(basic_string&amp;)): Only copy initialized
	portions of the buffers.
	(basic_string::_M_replace): Add constexpr implementation that
	doesn't depend on pointer comparisons.
	* include/bits/cow_string.h: Adjust comment.
	* include/ext/type_traits.h (__is_null_pointer): Add constexpr.
	* include/std/string (erase, erase_if): Add constexpr.
	* include/std/version (__cpp_lib_constexpr_string): Update
	value.
	* testsuite/21_strings/basic_string/cons/char/constexpr.cc:
	New test.
	* testsuite/21_strings/basic_string/cons/wchar_t/constexpr.cc:
	New test.
	* testsuite/21_strings/basic_string/literals/constexpr.cc:
	New test.
	* testsuite/21_strings/basic_string/modifiers/constexpr.cc: New test.
	* testsuite/21_strings/basic_string/modifiers/swap/char/constexpr.cc:
	New test.
	* testsuite/21_strings/basic_string/modifiers/swap/wchar_t/constexpr.cc:
	New test.
	* testsuite/21_strings/basic_string/version.cc: New test.
</pre>
</div>
</content>
</entry>
</feed>
