From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D452339B7029; Wed, 21 Apr 2021 12:25:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D452339B7029 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/64194] [C++14] for function template with auto return Date: Wed, 21 Apr 2021 12:25:06 +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: 5.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 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 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: Wed, 21 Apr 2021 12:25:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D64194 --- Comment #19 from CVS Commits --- The releases/gcc-9 branch has been updated by Patrick Palka : https://gcc.gnu.org/g:9499fe0403e310f4eb1f23279bff84259e120e76 commit r9-9453-g9499fe0403e310f4eb1f23279bff84259e120e76 Author: Patrick Palka Date: Wed Jul 29 22:06:44 2020 -0400 c++: overload sets and placeholder return type [PR64194] In the testcase below, template argument deduction for the call g(id) goes wrong because the functions in the overload set id each have a yet-undeduced auto return type, and this undeduced return type makes try_one_overload fail to match up any of the overloads with g's parameter type, leading to g's template argument going undeduced and to the overload set going unresolved. This patch fixes this issue by performing return type deduction via instantiation before doing try_one_overload, in a manner similar to what resolve_address_of_overloaded_function does. gcc/cp/ChangeLog: PR c++/64194 * pt.c (resolve_overloaded_unification): If the function template specialization has a placeholder return type, then instantiate it before attempting unification. gcc/testsuite/ChangeLog: PR c++/64194 * g++.dg/cpp1y/auto-fn60.C: New test. (cherry picked from commit 2c58f5cadfac338a67723fd6e41c9097760c4a33)=