[committed] libstdc++: Include <stddef.h> for size_t and ptrdiff_t [PR104123]

Jonathan Wakely jwakely@redhat.com
Wed Jan 19 17:40:52 GMT 2022


Tested x86_64-linux, pushed to trunk.


libstdc++-v3/ChangeLog:

	PR libstdc++/104123
	* testsuite/29_atomics/headers/stdatomic.h/c_compat.cc: Include
	<stddef.h>.
---
 .../testsuite/29_atomics/headers/stdatomic.h/c_compat.cc     | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/c_compat.cc b/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/c_compat.cc
index 98c1102a974..80d2e150647 100644
--- a/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/c_compat.cc
+++ b/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/c_compat.cc
@@ -92,12 +92,13 @@ static_assert(is_same<atomic_uint_fast64_t, _Atomic(uint_fast64_t)>);
 #endif
 static_assert(is_same<atomic_intptr_t,  _Atomic(intptr_t)>);
 static_assert(is_same<atomic_uintptr_t, _Atomic(uintptr_t)>);
-static_assert(is_same<atomic_size_t,    _Atomic(size_t)>);
-static_assert(is_same<atomic_ptrdiff_t, _Atomic(ptrdiff_t)>);
 #ifdef _GLIBCXX_USE_C99_STDINT_TR1
 static_assert(is_same<atomic_intmax_t,  _Atomic(intmax_t)>);
 static_assert(is_same<atomic_uintmax_t, _Atomic(uintmax_t)>);
 #endif
+#include <stddef.h>
+static_assert(is_same<atomic_size_t,    _Atomic(size_t)>);
+static_assert(is_same<atomic_ptrdiff_t, _Atomic(ptrdiff_t)>);
 
 static_assert( requires (::atomic_int* i, int* e) {
   ::atomic_is_lock_free(i);
-- 
2.31.1



More information about the Gcc-patches mailing list