From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C46C3395BC09; Wed, 27 May 2020 15:24:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C46C3395BC09 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590593040; bh=L33F2rDvb8mDy6ZMAtAK1BR5j7sPBWNabUxHnO9MSms=; h=From:To:Subject:Date:From; b=QpUI+tsIW/kDixBOW341sRbYeE7e4xAEpoYuV4x/UOwb+yTY3ufJ2qzCDqnh1bZd6 sUK/AHT4nSPLoSFT1I3FeHHbwPSMGHj32hHgwzlRwPNKnXcT5iFpQiVMbxisf0ENOo 5OB0DMvUYko2LbtX6Fc9814MElrDGo8QHLUAmjh4= From: "rafael at espindo dot la" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95368] New: gcc things that a lambda capture is both const and mutable Date: Wed, 27 May 2020 15:24:00 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rafael at espindo dot la 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2020 15:24:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95368 Bug ID: 95368 Summary: gcc things that a lambda capture is both const and mutable Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: rafael at espindo dot la Target Milestone: --- gcc accepts #include struct foo { void func(); }; void bar(foo& v) { [v]() { static_assert(std::is_same_v); [v]() mutable { static_assert(std::is_same_v); // v.func();=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 }(); }(); } But uncomment the call and you get test.cc:12:20: error: passing =E2=80=98const foo=E2=80=99 as =E2=80=98this= =E2=80=99 argument discards qualifiers [-fpermissive] 12 | v.func();=