From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 55B0E383FBB4; Sat, 19 Aug 2023 08:44:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 55B0E383FBB4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692434682; bh=R6rlD3z3upe5/uJM4Pq+iQf/ZR2D+/ev+Vs8iAcT42k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aL0I8nVJpMPAL6JgkTJX1S2fpdYBZFnt8z65c9wg3eJgMBPUqJdR3BQ/h88gM4xGt XumcoTWepf9OlTWrHhkP7WET031V/CpRRLS0qch5bcvHohZNrYRkpFCL5ZRtQp+jOt BSe8n+lCiCQqu3vKBOlSgVsrXk8b2PYL0CM04asA= From: "waffl3x at protonmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/102609] [C++23] P0847R7 - Deducing this Date: Sat, 19 Aug 2023 08:44:39 +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: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: waffl3x at protonmail dot com X-Bugzilla-Status: NEW 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=3D102609 --- Comment #7 from waffl3x --- struct S { int f(this S*) { return 5; } }; int main() { S s{}; return s.f(); } Here is my current progress, this code works. I have a good feeling that the rest is going to be easy. Except for deduction maybe, but I have a minor hu= nch that it might -just work- without any extra tinkering after everything else= has been implemented. Also yes, I know that `int f(this S*)` is not a valid declaration, I just didn't have to change any member function call code for it to work this way= so I made it my first goal to implement it this way. Actually, I guess it's not explicitly invalid is it? I don't recall seeing = it in the pathological cases section of the paper, indeed, I just checked and there doesn't seem to be mention of it. I believe it should probably be val= id though, not useful if you ask me. Even less so than the other pathological cases (which I think might actually prove to be useful in some cases.) Howe= ver, regardless of my opinion, following the same direction as the original pape= r, I imagine it should be allowed. The class would just need an implicit convers= ion to pointer, maybe a warning would be in order though?=