From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 2F9C7385AE6C for ; Thu, 7 Dec 2023 20:56:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2F9C7385AE6C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2F9C7385AE6C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701982589; cv=none; b=r6Uvaey26586Zi1tbAcOhHud4WotPfbQPBKGqNyL9OBS1nxSdsg+xNgBY/LJZ6dX9zVfO9NgZvoUhqmYOq99A0s7tqYngNqEJ4IdMvBBRy2+cNbwltdlsXC7DTbEp03mq+eMxt7A7FRVxxstNhjc1LqQnep1gp0nTnBhrBFwIqs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701982589; c=relaxed/simple; bh=Jy34Xv3Pbolgep97/HS1F7K0Mn4okE/xboGpcJvEjYw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=QoNY/FpQrV6cQhWXdGizuqpQABNxSNscLYbYc8JgjB9CE9ZUV+/LY2w/uHK4A9mwhViuZzIo/DV6Qb919ytCf24TQsMbnJ3SDOkIB4R/4gK8DWUy2ofs8ooIh+fa6bDcHy0DkRHDfVufdsohdLrcMxNcJQs+Nlddi0q4WfRQPQQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701982587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xV5TsU3c3UvgIWZLfCgVZoliiPQpTvV4+5ps35d45Rc=; b=Jzak6Qzo9N8T2A+6t0jogqyNDvYn+KpE+Y0xiJUfydVt3M86OxU1zz1XmHSxRU/8Gg3V6v EnDGir0RxDl5mrhTTYxcW/iUrJ9+hQD/4ZFmdDMkBdzJSIbA+F5Se10/XT3sSHzxhASUtT LTrukGUwik64qco5BfbvtWV0hR1Sus8= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-97-hoTaeDXGNbuumdEUqiyS_Q-1; Thu, 07 Dec 2023 15:56:26 -0500 X-MC-Unique: hoTaeDXGNbuumdEUqiyS_Q-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0719329AC006; Thu, 7 Dec 2023 20:56:26 +0000 (UTC) Received: from localhost (unknown [10.42.28.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id C80238CD0; Thu, 7 Dec 2023 20:56:25 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Use instead of in Date: Thu, 7 Dec 2023 20:56:00 +0000 Message-ID: <20231207205625.950093-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Tested x86_64-linux. Pushed to trunk. I'll backport this too. -- >8 -- 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 . --- 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 -- 2.43.0