From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6F6223858D34; Wed, 6 Mar 2024 16:51:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6F6223858D34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709743888; bh=ZaJ1OJFJjFdjEvKdfcgPEcm/Y3LJrD/LSnn7Z332ek4=; h=From:To:Subject:Date:From; b=xsGQB9DWchT9ieQVBMqrPjos+Oh5QtN/pKs9jGY+dTNuUgG02bKGeBIPfghA+3fR7 LEccrOlvhD4d24HdwAG7MSfIPeuomHv0HDISXjffrxkcPfQLhUn7yH/Jepnr//JSm0 uhGf5xeym4ITYiQHk02g7yOwoGFKRmt+0ZVkHEZ8= From: "rl.alt.accnt at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114257] New: Error when 'this' is used in a lambda with an explicit object parameter Date: Wed, 06 Mar 2024 16:51:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rl.alt.accnt at gmail dot com 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 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=3D114257 Bug ID: 114257 Summary: Error when 'this' is used in a lambda with an explicit object parameter Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: rl.alt.accnt at gmail dot com Target Milestone: --- The following code (https://godbolt.org/z/3noEb3GG7) struct S { int x; auto foo() { return [*this](this auto &self) { this->x =3D 4; }; } }; raises this error on trunk : In lambda function: :6:7: error: invalid use of 'this' in non-member function 6 | this->x =3D 4; | ^~~~=