From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4913C3858D37; Fri, 3 Mar 2023 04:39:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4913C3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677818381; bh=Ppu5g7v3QXcuelynIUPFOMzh8bF5j3AFo3uH1n4Ax8Y=; h=From:To:Subject:Date:From; b=MGc6MQLX6f9rk++BcaxB1G+haX4EqnwNYFJ37Dj9UjtDvEuVBuUG/j/BteAlnuhnB ybgTGWEU/Pcn2lTtBoG/lcSFO4xPmTBinRstDngXtMhSOFagUYRotHaRw6cCiH+9mN oxwQSqFMZxKbiOi2/u739fedROScSni66wi/46ME= From: "headch at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: =?UTF-8?B?W0J1ZyBjKysvMTA5MDAxXSBOZXc6IOKAnG5vIGRlY2xhcmF0aW9u?= =?UTF-8?B?IG1hdGNoZXPigJ0gZm9yIGNvbXBsaWNhdGVkIG5vbi10eXBlIHRlbXBsYXRl?= =?UTF-8?B?IHBhcmFtZXRlcnM=?= Date: Fri, 03 Mar 2023 04:39:40 +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.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: headch at gmail dot com 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=3D109001 Bug ID: 109001 Summary: =E2=80=9Cno declaration matches=E2=80=9D for complicate= d non-type template parameters Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: headch at gmail dot com Target Milestone: --- I=E2=80=99m reasonably certain (but not completely) that this is valid code: #include #include template class C { public: template C set(); }; template template C C::set() { return {}; } however, GCC rejects it with =E2=80=9Cerror: no declaration matches =E2=80= =98C(x, y)> C::set()=E2=80=99=E2=80=9D on the out-of-body funct= ion definition. This is accepted in GCC 11.3, as well as the latest versions of Clang and MSVC on gcc.godbolt.org. Interestingly, GCC 12 also accepts the code if I change the function definition (just the definition, not the in-body declaration) to u= se trailing-return-type syntax: #include #include template class C { public: template C set(); }; template template auto C::set() -> C { return {}; }=