From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 374CD385E021; Mon, 29 Mar 2021 03:08:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 374CD385E021 From: "glenjofe at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/96416] to_address() is broken by static_assert in pointer_traits Date: Mon, 29 Mar 2021 03:08:26 +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: glenjofe at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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: Mon, 29 Mar 2021 03:08:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96416 --- Comment #16 from Glen Joseph Fernandes --- > should a wording defect be raised against std::to_address(Ptr), to state = that=20 > pointer_traits being well-formed is actually a prerequisite? That's not an omission in the specification of to_address. The function is intended for pointers, and specified in terms of checking for a pointer_traits

member, and this means pointer_traits

must be well-for= med.=20 Adding an additional text to the specification saying this explicitly is unlikely to help anyone. The real change that users of iterators[1] would w= ant is to make pointer_traits SFINAE friendly. [1] Users of pointers don't care much, since all the pointer types people a= re using with to_address(p) already have a well-formed pointer_traits

.=