From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6D8E43858CDB; Fri, 8 Dec 2023 20:38:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D8E43858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1702067921; bh=hQ1ZIemrTWlUrtC0i04UUFssh8kCE6zQZXM2Iug3uns=; h=From:To:Subject:Date:From; b=oqRr2Gk5Yej2zw9+a7se6uPyUrByTiG/2lHhgv2wzcoQmLqRv9iivEE/sZ6bwCxyr WxADPNvWTcXF3dvvVfI9Y5QuUCTGSHhn+jWIZZyzlpsbAX+b88oA1yzYgrVdlrPBow DqLXz5bIf2lwedodWtILGd8H43L8Z7ih2kiDIZsg= From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/112926] New: issues with nested lambdas and decltype of uncaptured local variable Date: Fri, 08 Dec 2023 20:38:40 +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: ppalka 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: 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=3D112926 Bug ID: 112926 Summary: issues with nested lambdas and decltype of uncaptured local variable Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ppalka at gcc dot gnu.org Target Milestone: --- Here since the outer lambda has no capture-default, using x outside of an unevaluated operand wouldn't capture it (despite the by-copy capture-defaul= t of the inner lambda), so the special case in https://eel.is/c++draft/expr.prim.id.unqual#3 doesn't apply and decltype((x) should be int& not const int&. int main() { int x; [] { [=3D] { using type =3D decltype((x)); // should be int& not const int& using type =3D int&; }; }; }=