]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix test FAIL due to -Wpointer-arith
authorJonathan Wakely <jwakely@redhat.com>
Thu, 26 Sep 2024 22:38:41 +0000 (23:38 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 27 Sep 2024 15:28:12 +0000 (16:28 +0100)
commit500046d178bc78a8f18d529c62f7b45c8ad2c861
tree4347b8d5900961cde2eca19d19f21b130fa81b8b
parent0ff49a5c1d39382c57d614a29510559068947376
libstdc++: Fix test FAIL due to -Wpointer-arith

This fixes a FAIL due to a -Wpointer-arith warning when testing with
c++11 or c++14 dialects. As an extension our std::atomic<void*> supports
pointer arithmetic in C++11 and C++14, but due to the system header
changes there is now a warning about it. The warning seems reasonable,
so rather than suppress it we should make the test expect it.

While looking into this I decided to simplify some of the code related
to atomic<T*> arithmetic.

libstdc++-v3/ChangeLog:

* include/bits/atomic_base.h (__atomic_base<T*>::_M_type_size):
Replace overloaded functions with static _S_type_size.
* include/std/atomic (atomic<T*>): Use is_object_v instead of
is_object.
* testsuite/29_atomics/atomic/operators/pointer_partial_void.cc:
Add dg-warning for -Wpointer-arith warning.
libstdc++-v3/include/bits/atomic_base.h
libstdc++-v3/include/std/atomic
libstdc++-v3/testsuite/29_atomics/atomic/operators/pointer_partial_void.cc