From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 2D5D53858C98; Sat, 9 Dec 2023 22:04:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D5D53858C98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1702159485; bh=cejuSlyWGUPKqo4zh78jo6H0fllj4uiAAj1u+Ye9D2U=; h=From:To:Subject:Date:From; b=izElk/FjHj5BKIp85iT5MGTeapkJaw9LrkyPZryNIttGrkiz1ftxeRuqPepOu3fCy cTO/0HZCfPp9ASkDTPqqB5ygCd4fCeJKm5uobiQPI06c/P75FUw/UihTH81/9A04ff zHnT4p+r5yMa8UeiEoGJPznPWHvKc7V5DQzTe0Qc= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-8138] libstdc++: Use instead of in X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-13 X-Git-Oldrev: a154ae8a07264e4d7091657107c972f3df5e6f82 X-Git-Newrev: d62feab6aa7d023f7ba916f1618b8a6137ac5659 Message-Id: <20231209220445.2D5D53858C98@sourceware.org> Date: Sat, 9 Dec 2023 22:04:45 +0000 (GMT) List-Id: https://gcc.gnu.org/g:d62feab6aa7d023f7ba916f1618b8a6137ac5659 commit r13-8138-gd62feab6aa7d023f7ba916f1618b8a6137ac5659 Author: Jonathan Wakely Date: Thu Dec 7 11:00:02 2023 +0000 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 . (cherry picked from commit 2f512f6fcdd55296daff3e01a250d866491014e6) Diff: --- libstdc++-v3/include/bits/atomic_wait.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/include/bits/atomic_wait.h b/libstdc++-v3/include/bits/atomic_wait.h index aaf36832ea3..fc840578c22 100644 --- a/libstdc++-v3/include/bits/atomic_wait.h +++ b/libstdc++-v3/include/bits/atomic_wait.h @@ -34,7 +34,7 @@ #include #if defined _GLIBCXX_HAS_GTHREADS || defined _GLIBCXX_HAVE_LINUX_FUTEX -#include +#include #include #include #include