From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 981AD383FF7D; Sat, 17 Dec 2022 16:39:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 981AD383FF7D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671295162; bh=Tp3t2ytqAPMqff6fjkwmsTb3VaMzZ9EhJlyjf4kwQn4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kMXPoWNqmyLd3lOxollqG4z7jl/yNOzBiZkfYYXI+8UqFHrhDavBbOuF/Y4GMOlOS J4iUzfv8Sf39J2BpyrpVOefbRx8U5KU4JK7S8FRdDapEQR5I4n9G50+Hv27q6ljRpZ 8S8GP/PMbe01R/Nuvpn8qsW8m2IAahW3OcSTcsnw= From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107437] nested generic lambdas fail requiring unneded captures Date: Sat, 17 Dec 2022 16:39:22 +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.2.0 X-Bugzilla-Keywords: c++-lambda, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ppalka 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=3D107437 --- Comment #5 from Patrick Palka --- Reduced version of the original testcase: struct integral_constant { constexpr operator int() const { return 42; } }; template struct A { static constexpr int value =3D N; }; template struct B { static constexpr int value =3D T::value; }; template void f(T t) { using alias =3D A; [](auto) { B a; // { dg-bogus "'t' is not captured" } return a.value; }(0); } template void f(integral_constant);=