From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id F068A3858417; Thu, 7 Dec 2023 20:55:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F068A3858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701982549; bh=9PSiHniBbP3mXZ6zN5+9GQilUO6ne37y+FCnhpmO638=; h=From:To:Subject:Date:From; b=lXtoKvnormZI/jPcUypS/pMipIa2HpFKkxXORJv+zAIJrqtBYLMXdh7svpxBlpML7 WRvtkXnOFvp675ocIYRbY9zEYalYUu7g3KOeEZy39ly3s2SP3rB140JfGQ5ef/4PO6 AyKtsXNZsaoKYFp2AVREQdQCQo40XCBivtrN0cSI= 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 r14-6292] libstdc++: Use instead of in X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 1395c573c523762957bde8c2a08832c5f4350815 X-Git-Newrev: 2f512f6fcdd55296daff3e01a250d866491014e6 Message-Id: <20231207205549.F068A3858417@sourceware.org> Date: Thu, 7 Dec 2023 20:55:49 +0000 (GMT) List-Id: https://gcc.gnu.org/g:2f512f6fcdd55296daff3e01a250d866491014e6 commit r14-6292-g2f512f6fcdd55296daff3e01a250d866491014e6 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 . 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 1460b1d8d5c..8e01a9c518d 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