From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1A9B83858410; Thu, 31 Aug 2023 11:38:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A9B83858410 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693481925; bh=/IVG5CQLV9bRLPLSMrVwik4qQU1tYRyWRIPpbmrIX/U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jUioiog8tQ5/C2e/SOwtt4d8fdIisenZIma3cUdi1xDS065FPaVyxOtA3PVyUbu/i QczsitblQ7FQ8Mxry2YXuGIL3Hi+6Leyqz56hd4qC+qgc8MwmBqqvNP2sq2WV4bbyC KFDB3cMzVvgeDGZs8B+KeOZycff4VNpcy41X7Bww= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/102610] [C++23] P2036R3 - Change scope of lambda trailing-return-type Date: Thu, 31 Aug 2023 11:38:44 +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: jakub at gcc dot gnu.org 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: cc 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=3D102610 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek --- Related question for the last paper: https://github.com/cplusplus/draft/issues/6536 Other than that, I guess opening a new sk_lambda scope in cp_parser_lambda_declarator_opt at the start and leaving it at the end shou= ld be easy, but we only build_capture_proxy later on. Shall we pushdecl into the sk_la= mbda scope instead the LAMBDA_CAPTURE_EXPLICIT_P && !DECL_NORMAL_CAPTURE_P captures and somehow special-case them in name lookup or just finish_decltype_type where= we currently handle the if (outer_automatic_var_p (expr) && current_function_decl && LAMBDA_FUNCTION_P (current_function_decl)) type =3D capture_decltype (expr); case? Though, in the lambda declarator, current_function_decl is still the containing function and outer_automatic_var_p also will not work. I guess = we need some way to know whether we are in the lambda declarator (and also whe= ther it is before the end of parameter declarations or after and whether in the latter case the lambda is mutable or not) and special case in that case both the init-captures and automatic? vars from the current function (which will be outer vars in lamb= da body).=