From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1CF02385842C; Wed, 7 Feb 2024 22:07:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1CF02385842C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707343676; bh=a2OuzKEO2EhDY1yoHdqqW+xWyXnkwrkc346xDL6dYVM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aG9Yj1CJLgZ/7DK0JkRn+821gW1zvn9eSTJpDa9X9dlvqvj4fS1fCQalg6g0jUuxl qTRUpE+knJqZLnShxlSXXzRZmxPGStZZa9j96VMDYmAZIojkJZXL6FhZid4DParA20 iufIq50/zsW/FWbvBbPxtx6E691Szxs1pJGjCbEY= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/113074] std::to_address should be SFINAE safe Date: Wed, 07 Feb 2024 22:07:55 +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: 13.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113074 --- Comment #11 from Jonathan Wakely --- (In reply to Peter Kasting from comment #8) > There's currently no simple and blessed route for consumers to convert > raw-or-fancy-pointer input types to raw pointers. I disagree, std::to_address does exactly that. The problem here seems to be that Chromium is expecting it to do more than that. Given a raw-or-fancy-pointer std::to_address will turn it into a raw pointe= r. What the testcase above seems to be trying to do is to use std::to_address = as a proxy for answering the question "is this a raw or fancy pointer". That's n= ot what it's for. Can't you use something like this to check that instead? template concept IsPointerLike =3D requires { typename std::pointer_traits::point= er; } || requires (const T& t) { t.operator->(); };=