From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 22ABD3858C2B; Thu, 21 Sep 2023 11:37:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 22ABD3858C2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695296223; bh=5V7YW4CxWBBjjfMaszxJvIQIYBXearBZTQbqPqR0ecM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=sOCX5g5jczUihuFVx60Smz6uaE71RJZD/RVFo05599P91DMUwDTQE9HgH/caBtr7E 1cdaUmu1+V+oV0eOZ1R2hacKe3szl7l2Djc6cjpj9ClqhXR0LAksyMmBS4A91q5vu4 esKGl/kfsDyRqaNjQp7vIOLzONm+koXYT6GufDhc= From: "de34 at live dot cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/111511] Incorrect ADL in std::to_array in GCC 11/12/13 Date: Thu, 21 Sep 2023 11:37:01 +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.1 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: de34 at live dot cn X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi 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=3D111511 --- Comment #5 from Jiang An --- (In reply to m.cencora from comment #2) > (In reply to Jonathan Wakely from comment #1) > > (In reply to Jiang An from comment #0) > > > Not sure whether this should be WONTFIX since the implementation is > > > fundamentally changed in GCC 14 (PR 110167). > >=20 > > There's no reason we can't fix the old version in the release branches. > >=20 > > I did notice this when rewriting it, but I didn't think to change the > > branches to avoid ADL there, because I plan to backport the new > > implementation eventually anyway. >=20 > On a semi-related topic: > Can't we use __builtin_bit_cast as even simpler implementation of to_array > for trivial types? __builtin_bit_cast results in constant evaluation failure when the element = type is or contains a pointer or a union, which heavily restricts its usability = in to_array.=