gcc/libstdc++-v3/testsuite
Thomas W Rodgers 7c21556daf libstdc++: Make atomic notify_one and notify_all non-const
<recording this here for future reference>
PR102994 "atomics: std::atomic<ptr>::wait is not marked const" raises the
issue that the current libstdc++ implementation marks the notify members
const, the implementation strategy used by libstdc++, as well as libc++
and the Microsoft STL, do not require the atomic to be mutable (it is hard
to conceive of a desirable implementation approach that would require it).
The original paper proposing the wait/notify functionality for atomics
(p1185) also had these members marked const for the first three revisions,
but that was changed without explanation in r3 and subsequent revisions of
the paper.

After raising the issue to the authors of p1185 and the author of the
libc++ implementation, the consensus seems to be "meh, it's harmless" so
there seems little appetite for an LWG issue to revisit the subject.

This patch changes the libstdc++ implementation to be in agreement with
the standard by removing const from those notify_one/notify_all members.

libstdc++-v3/ChangeLog:

	PR libstdc++/102994
	* include/bits/atomic_base.h (atomic_flag::notify_one,
	notify_all): Remove const qualification.
	(__atomic_base::notify_one, notify_all): Likewise.
	* include/std/atomic (atomic<bool>::notify_one, notify_all):
	Likewise.
	(atomic::notify_one, notify_all): Likewise.
	(atomic<T*>::notify_one, notify_all): Likewise.
	(atomic_notify_one, atomic_notify_all): Likewise.
	* testsuite/29_atomics/atomic/wait_notify/102994.cc: Adjust test
	to account for change in notify_one/notify_all signature.
2022-04-22 15:53:41 -07:00
..
17_intro libstdc++: Fix test failure on AIX 2022-03-03 22:25:44 +00:00
18_support testsuite: Disable tests for C++23 that depend on std::unexpected 2022-03-29 20:30:43 +01:00
19_diagnostics libstdc++: Reduce memory usage in std::stacktrace::current 2022-04-12 22:38:31 +01:00
20_util libstdc++: Remove bogus assertion in std::from_chars [PR105324] 2022-04-21 11:31:51 +01:00
21_strings libstdc++: Fix macro checked by test 2022-04-20 13:54:57 +01:00
22_locale libstdc++: Fix typos in comments in tests 2022-03-28 12:20:42 +01:00
23_containers libstdc++: Fix missing and incorrect feature test macros [PR105269] 2022-04-14 11:02:37 +01:00
24_iterators libstdc++: Avoid overflow in ranges::advance(i, n, bound) 2022-01-27 22:24:29 +00:00
25_algorithms libstdc++: Avoid double-deref of __first in ranges::minmax [PR104858] 2022-04-15 14:41:14 -04:00
26_numerics libstdc++: Add missing constraints to std::bit_cast [PR105027] 2022-03-23 12:17:16 +00:00
27_io libstdc++: Do not use dirent::d_type unconditionally 2022-02-02 00:01:43 +00:00
28_regex libstdc++: Add dg-timeout-factor to some more regex tests 2022-01-10 12:18:14 +00:00
29_atomics libstdc++: Make atomic notify_one and notify_all non-const 2022-04-22 15:53:41 -07:00
30_threads Update copyright years. 2022-01-03 10:42:10 +01:00
abi Update copyright years. 2022-01-03 10:42:10 +01:00
backward Update copyright years. 2022-01-03 10:42:10 +01:00
config Update copyright years. 2022-01-03 10:42:10 +01:00
data
decimal Update copyright years. 2022-01-03 10:42:10 +01:00
experimental libstdc++: Adjust Filesystem TS test for Windows 2022-02-08 13:31:09 +00:00
ext libstdc++: Add attribute to features deprecated in C++17 [PR91260] 2022-01-14 11:27:50 +00:00
lib libstdc++: Define <stacktrace> header for C++23 2022-01-17 12:13:02 +00:00
libstdc++-abi Update copyright years. 2022-01-03 10:42:10 +01:00
libstdc++-dg Update copyright years. 2022-01-03 10:42:10 +01:00
libstdc++-prettyprinters libstdc++: Add pretty printer for std::span 2022-04-19 14:18:33 +01:00
libstdc++-xmethods Update copyright years. 2022-01-03 10:42:10 +01:00
performance libstdc++: Optimize operations on small size hashtable [PR 68303] 2022-01-05 21:46:52 +01:00
special_functions Update copyright years. 2022-01-03 10:42:10 +01:00
std libstdc++: Reduce header dependencies from PSTL headers [PR92546] 2022-03-18 10:16:36 +00:00
tr1 libstdc++: Add attribute to features deprecated in C++17 [PR91260] 2022-01-14 11:27:50 +00:00
tr2 Update copyright years. 2022-01-03 10:42:10 +01:00
util libstdc++: Fix comment in testsuite utility 2022-03-17 12:23:56 +00:00
Makefile.am Update copyright years. 2022-01-03 10:42:10 +01:00
Makefile.in libstdc++: Define <stacktrace> header for C++23 2022-01-17 12:13:02 +00:00