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 98F043858033 for ; Fri, 2 Feb 2024 10:39:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 98F043858033 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 98F043858033 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=1706870402; cv=none; b=m0olhz7hNheQSj7ED51GnHinLup/wJ7ghhH2y+XiLssKo6e+wpKPmyY1huhPBTk20Pih61siPk/DPbYRY9TENJvDLVISzs5B6sEXZmJ3Ct11SSgWQfZQImKT8Jz6bER7ltORiOvzGkyfA40uH2wY1hi2zyTarCLqySASj7XM2Aw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706870402; c=relaxed/simple; bh=dNK3AAsqXU0LWZgsTJX+Fa1PVK3P+Eb/qX+6vuH0Zdc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Ri+yypV4fbL5kiz4i/ZsFjzTAFQvrzUisqvWcWVYv1jM2IEc/Rfu6tR63Fd+WvVlBZiU+/MlJvI2JcA2mCV+7ZGwFZj+fyozpgOA+HsLVFODuuP5k9s7VZy1immgLHZ0nyB3ARfAt6j271ZQc8swZv/9KXw0T477MIATfezGTiE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706870399; 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=sjtYpjlYjn1Lr7F0u/uB8XY6fABcg4YTMR+FYWhnfIA=; b=eBc76p+tjfD0gt69AW74veTnMtPBxfWN5TzITtFYmYh1IAcEvyBMioLOxxTnBdaE7srzaH GLYT+hbL+bypZEFbb1obq9Cr+55agzSpl7ekJC9z0oCIjpOS80y2G3Rth9klV4RDoMv/OE sF4at+/KAF8DgVbEgtEIRjfFWVlZoNk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-145-V-LYGRdLPeyihBWQmss5nQ-1; Fri, 02 Feb 2024 05:39:57 -0500 X-MC-Unique: V-LYGRdLPeyihBWQmss5nQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 7CDB4106D103; Fri, 2 Feb 2024 10:39:57 +0000 (UTC) Received: from localhost (unknown [10.42.28.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 47F571121306; Fri, 2 Feb 2024 10:39:57 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed,gcc-12] libstdc++: Force-inline shared_ptr::operator bool() for C++20 [PR108636] Date: Fri, 2 Feb 2024 10:39:25 +0000 Message-ID: <20240202103952.2243921-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.0 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_H2,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 releases/gcc-12 branch. -- >8 -- This avoids a linker error with -fkeep-inline-functions when including . We can't backport the fix from trunk because it adds an export to the shared library. By marking the "missing" symbol always_inline for C++20 mode we don't need a definition in the library. libstdc++-v3/ChangeLog: PR libstdc++/108636 * include/bits/shared_ptr_base.h (__shared_ptr::operator bool): Add always_inline attribute for C++20 and later. --- libstdc++-v3/include/bits/shared_ptr_base.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h index c22b397a194..23c3b17d46f 100644 --- a/libstdc++-v3/include/bits/shared_ptr_base.h +++ b/libstdc++-v3/include/bits/shared_ptr_base.h @@ -1666,6 +1666,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return _M_ptr; } /// Return true if the stored pointer is not null. +#if __cplusplus >= 202002L + [[__gnu__::__always_inline__]] +#endif explicit operator bool() const noexcept { return _M_ptr != nullptr; } -- 2.43.0