From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A651B38582A6; Tue, 25 Oct 2022 09:52:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A651B38582A6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666691566; bh=6omtdTjvfOAiA2yyDN/n/Mv/NbbZJlppvFhMxcPOY/Y=; h=From:To:Subject:Date:From; b=moy4M32igEeAjLDqvAQW8nioQf8V8pxh83y61LQF97vGZ8a4BsDYBzft3HNRj6xYE m38SHPaX9I33C4WBHXN7JhmeRJvg7oS2sVIoe/eiyioDHrYHXS99EXmYwKDmZKcS69 pBmIOmSIT0BFD1oP194hUcECbTsfajJTuZCbyOgI= From: "development at jordi dot vilar.cat" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107390] New: template-nested lambda type uniqueness Date: Tue, 25 Oct 2022 09:52:41 +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: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: development at jordi dot vilar.cat 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=3D107390 Bug ID: 107390 Summary: template-nested lambda type uniqueness Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: development at jordi dot vilar.cat Target Milestone: --- type obtained from a lambda (with c++20 decltype()) nested into a template (either class o function) is not resolved as a unique type, making this sim= ple code to fail (compiled with g++-12 -std=3Dc++20): #include template struct test1 { using type0 =3D decltype([]{}); using type1 =3D std::type_identity_t; static_assert(std::is_same_v); }; template void test2() { using type0 =3D decltype([]{}); using type1 =3D std::type_identity_t; static_assert(std::is_same_v); } int main(int, char**) { test1{}; test2(); } both static_assert fail identically: error: static assertion failed 8 | static_assert(std::is_same_v); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~ :8:24: note: 'std::is_same_v::, test1:: >' evaluates to false :16:24: error: static assertion failed 16 | static_assert(std::is_same_v); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~ :16:24: note: 'std::is_same_v()::, test2():: >' evaluates to false This compiles correctly if lambdas are not nested inside a template.=