From: Jonathan Wakely Date: Thu, 7 Dec 2023 11:00:02 +0000 (+0000) Subject: libstdc++: Use instead of in X-Git-Tag: basepoints/gcc-15~3847 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f512f6fcdd55296daff3e01a250d866491014e6;p=thirdparty%2Fgcc.git libstdc++: Use instead of in In r14-5922-g6c8f2d3a08bc01 I added to , so that uintptr_t is declared if that header is compiled as a header unit. I used because that's what already includes, so it seemed simpler to be consistent. However, this means that name lookup for uintptr_t in depends on whether has been included by another header first. Whether name lookup finds std::uintptr_t or ::uintptr_t will depend on include order. This causes problems when compiling modules with Clang: bits/atomic_wait.h:251:7: error: 'std::__detail::__waiter_pool_base' has different definitions in different modules; first difference is defined here found method '_S_for' with body _S_for(const void* __addr) noexcept ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bits/atomic_wait.h:251:7: note: but in 'tm.' found method '_S_for' with different body _S_for(const void* __addr) noexcept ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ By including we would ensure that name lookup always finds the name in namespace std. Alternatively, we can stop including for those types, so that we don't declare the entire contents of when we only need a couple of types from it. This patch does the former, which is appropriate for backporting. libstdc++-v3/ChangeLog: * include/bits/atomic_wait.h: Include instead of . --- diff --git a/libstdc++-v3/include/bits/atomic_wait.h b/libstdc++-v3/include/bits/atomic_wait.h index 1460b1d8d5cd..8e01a9c518d8 100644 --- a/libstdc++-v3/include/bits/atomic_wait.h +++ b/libstdc++-v3/include/bits/atomic_wait.h @@ -35,7 +35,7 @@ #include #if __glibcxx_atomic_wait -#include +#include #include #include #include