From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 860593858036; Fri, 26 Nov 2021 17:46:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 860593858036 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/96416] [DR 3545] to_address() is broken by static_assert in pointer_traits Date: Fri, 26 Nov 2021 17:46:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: SUSPENDED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Nov 2021 17:46:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96416 --- Comment #22 from CVS Commits --- The releases/gcc-11 branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:8d3391d64799d490117ad48432a9ad2cf38b0091 commit r11-9317-g8d3391d64799d490117ad48432a9ad2cf38b0091 Author: Jonathan Wakely Date: Thu Nov 25 23:29:08 2021 +0000 libstdc++: Make std::pointer_traits SFINAE-friendly [PR96416] This is a simplified version of r12-5532 for the release branches. It still removes the problematic static_assert, but rather than making std::pointer_traits completely empty when the element_type can't be deduced, it just disables element_type and pointer_to. Additionally, the pointer_to member is not completely absent when element_type is cv void, it just has an unusable signature. This is sufficient to avoid errors outside the immediate context when trying to use std::to_address. libstdc++-v3/ChangeLog: PR libstdc++/96416 * include/bits/ptr_traits.h (pointer_traits): Remove static_assert checking for valid element_type. (pointer_traits::element_type, pointer_traits::pointer_to): Do not define when element type cannot be deduced. * testsuite/20_util/pointer_traits/lwg3545.cc: New test. * testsuite/20_util/to_address/1_neg.cc: Adjust dg-error line. * testsuite/20_util/to_address/lwg3545.cc: New test. (cherry picked from commit b8018e5c5ec0e9b6948182f13fba47c67b758d8a)=