e4379a931d
This implements the new requirements for C++20 that std::atomic should initialize the atomic variable in its default constructor. This patch does not add the deprecated attribute to atomic_init, but that should be done at some point as it's deprecated in C++20. The paper also deprecates the ATOMIC_FLAG_INIT macro, although we can't apply the deprecated attribute to a macro. PR libstdc++/58605 * include/bits/atomic_base.h (__cpp_lib_atomic_value_initialization): Define. (__atomic_flag_base, __atomic_base, __atomic_base<_PTp*>) (__atomic_float): Add default member initializer for C++20. * include/std/atomic (atomic): Likewise. (atomic::atomic()): Remove noexcept-specifier on default constructor. * include/std/version (__cpp_lib_atomic_value_initialization): Define. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust dg-error line number. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise. * testsuite/29_atomics/atomic/cons/value_init.cc: New test. * testsuite/29_atomics/atomic_flag/cons/value_init.cc: New test. * testsuite/29_atomics/atomic_flag/requirements/trivial.cc: Adjust expected result for is_trivially_default_constructible. * testsuite/29_atomics/atomic_float/requirements.cc: Likewise. * testsuite/29_atomics/atomic_float/value_init.cc: New test. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Likewise. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Likewise. * testsuite/29_atomics/atomic_integral/cons/value_init.cc * testsuite/29_atomics/atomic_integral/requirements/trivial.cc: Adjust expected results for is_trivially_default_constructible. * testsuite/util/testsuite_common_types.h (has_trivial_dtor): Add new test generator. |
||
---|---|---|
.. | ||
common_type | ||
debug | ||
exception | ||
hash_fn | ||
io | ||
native_type | ||
performance | ||
pstl | ||
regression | ||
statistic | ||
thread | ||
replacement_memory_operators.h | ||
slow_clock.h | ||
specfun_testcase.h | ||
testsuite_abi_check.cc | ||
testsuite_abi.cc | ||
testsuite_abi.h | ||
testsuite_allocator.cc | ||
testsuite_allocator.h | ||
testsuite_api.h | ||
testsuite_character.cc | ||
testsuite_character.h | ||
testsuite_common_types.h | ||
testsuite_container_traits.h | ||
testsuite_containergen.h | ||
testsuite_containers.h | ||
testsuite_counter_type.h | ||
testsuite_error.h | ||
testsuite_fs.h | ||
testsuite_greedy_ops.h | ||
testsuite_hooks.cc | ||
testsuite_hooks.h | ||
testsuite_io.h | ||
testsuite_iterators.h | ||
testsuite_new_operators.h | ||
testsuite_performance.h | ||
testsuite_random.h | ||
testsuite_regex.h | ||
testsuite_rng.h | ||
testsuite_rvalref.h | ||
testsuite_shared.cc | ||
testsuite_tr1.h |