From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1E0FB3858D32; Thu, 2 Nov 2023 18:24:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1E0FB3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698949477; bh=AiVccLAwYvUD6RndxmRpKhTpbi4b9IRAxzzBY+L9SX8=; h=From:To:Subject:Date:From; b=cA3t3KisNWRd0sEbT6J2BfQSd8pG7TfL829BLbPfneN1708snn4VgxcGb1QkLbXnT vxpdDrDzIdniMjoAzn9ex7r8ih47HCJ3TwGmEnlRGDcbvYw7F6nG6S1ZNnszJbHnYG 9Qv+7P/v+0eBJOgLfIF9x957CzCnJsjoDpUZfpRA= From: "ed at catmur dot uk" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/112354] New: mismatched types 'B' and 'B&' for generic lambda noexcept-specifier referencing enclosing function parameter Date: Thu, 02 Nov 2023 18:24:36 +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: ed at catmur dot uk 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=3D112354 Bug ID: 112354 Summary: mismatched types 'B' and 'B&' for generic lambda noexcept-specifier referencing enclosing function parameter Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ed at catmur dot uk Target Milestone: --- Since 4.9.0, template struct B { B(); B(B const&); }; template void g(B, int); auto f(B x) { return [](auto y) noexcept(noexcept(g(x, y))) { return 1; }; } int i =3D f({})(0); fails with: : In instantiation of 'f(B):: [with auto:1 =3D int]': :12:14: required from here 12 | int i =3D f({})(0); | ~~~~~^~~ :8:42: error: no matching function for call to 'g(B&&, int&)' 8 | return [](auto y) noexcept(noexcept(g(x, y))) { | ~^~~~~~ :6:24: note: candidate: 'template void g(B, int)' 6 | template void g(B, int); | ^ :6:24: note: template argument deduction/substitution failed: :8:42: note: mismatched types 'B' and 'B&' 8 | return [](auto y) noexcept(noexcept(g(x, y))) { | ~^~~~~~=