From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 26331385DC00; Fri, 8 May 2020 14:39:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26331385DC00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588948764; bh=bY5vxfHF+EMh9XpSDRUDGQxIErp10Mt6P/bnUxrP8gA=; h=From:To:Subject:Date:From; b=fHdUm/L3+LOHhlE15GbHyz9Nxp4AHhQMSjO146jmJzdn4JgfqlYiU384hDFYMqduT 80rNkFda3ZWe7PW+2TOQQVspghBmks+AY+6KWY6XvqA1o8v4UdBQmmJnth+HoGVKpx NmyGyKEK1N94uwh2i/6CzMHZzmxKr/pCkmsSLABg= From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95010] New: Recursive function template with function parameter of type decltype([]{}) is rejected Date: Fri, 08 May 2020 14:39:23 +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: 10.0 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2020 14:39:24 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95010 Bug ID: 95010 Summary: Recursive function template with function parameter of type decltype([]{}) is rejected Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ppalka at gcc dot gnu.org Target Milestone: --- $ cat testcase.C template void foo(decltype([]{}) *s) { if (0) foo(s); } void bar() { foo(nullptr); } $ g++ -std=3Dc++2a testcase.C testcase.C: In instantiation of =E2=80=98void foo(decltype ()*) [wi= th T =3D int; decltype () =3D foo::]=E2=80=99: testcase.C:8:19: required from here testcase.C:4:12: error: cannot convert =E2=80=98*=E2=80=99 to =E2= =80=98*=E2=80=99 4 | foo(s); | ^ | | | * testcase.C:2:26: note: initializing argument 1 of =E2=80=98void foo(declt= ype ()*) [with T =3D int; decltype () =3D foo::]= =E2=80=99 2 | void foo(decltype([]{}) *s) { | ~~~~~~~~~~~~~~~~^ We should also accept: template void foo(decltype([]{}) *s, decltype(s) q) { foo(q, s); } void bar() { foo(nullptr, nullptr); }=