From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A79283858C52; Thu, 21 Sep 2023 06:17:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A79283858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695277033; bh=8hyUTnIrBS/o+79SZyux2pj+6rBV8iP02zYtG/wQn28=; h=From:To:Subject:Date:From; b=UUJwNrB+beY6C/lEab32iceV6K099r+LCeo9Zuxs5w/vG9wamPN/lGK3PJfJXp4O4 F91tMRpC2RRkZ3dUE+jsWaBbqwV2fFlSr17j2mc+8ZJDQvkCDRNyZivfmn6VT2WURH ZGfXx4hxC9qjnA/HnQV6GmWn9JfvbKgR6kHNI558= From: "de34 at live dot cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/111511] New: Incorrect ADL in std::to_array in GCC 11/12/13 Date: Thu, 21 Sep 2023 06:17:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 Bug ID: 111511 Summary: Incorrect ADL in std::to_array in GCC 11/12/13 Product: gcc Version: 13.2.1 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: de34 at live dot cn Target Milestone: --- The following program is incorrectly rejected when using libstdc++ (https://godbolt.org/z/x6K6r5svM). ``` #include #include struct incomplete; template struct holder { T t; }; using validator =3D holder*; int main() { validator a[1]{}; (void) std::to_array(a); (void) std::to_array(std::move(a)); } ``` The error is caused by aunqualified calls to the `__to_array` internal function, which triggers ADL for `incomplete` and requires it to be complet= e. Not sure whether this should be WONTFIX since the implementation is fundamentally changed in GCC 14 (PR 110167).=