From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A5127385694E; Mon, 12 Sep 2022 17:46:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A5127385694E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663004810; bh=BAzeJrUxh2HN7rahppNVum9An/a2mavFzD44gz5bPVU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IjTbZ0t+bue+KlM4gGshLpw3DP5qZINqCJBQVw717mQzPGWsJJBQnVaLvNDQinv/R gH84ISECXV4O00IjwJb3WDqooDciS1IEqsQ2uJmeWZC3vcIinB64kHkdRd9umqEml5 n7BcgBX9gpijf+DTIoqo5Pkz3uVZi8ZRHU383HGs= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106651] [C++23] P1169 - static operator() Date: Mon, 12 Sep 2022 17:46:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: cc attachments.created 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=3D106651 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek --- Created attachment 53565 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53565&action=3Dedit gcc13-pr106651-wip.patch WIP patch which has parts of the changes implemented. What is missing is [over.match.best.general]/1 and [over.best.ics.general] changes and the library side, which means e.g. for the testcase from the pa= per: struct less { static constexpr auto operator()(int i, int j) -> bool { return i < j; } using P =3D bool(*)(int, int); operator P() const { return operator(); } }; static_assert(less{}(1, 2)); we ICE. Testcase I've been playing with that compiles now: template struct S { static constexpr bool operator() (T const& x, T const& y) { return x < y;= }; }; template void bar (T &x) { x (1, 2); } void foo () { auto a =3D [](int x, int y) static { return x + y; }; bar (*a); auto b =3D [](T x, U y) static { return x + y; }; b (1, 2L); S s; s(1, 2); }=