From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A2A933844041; Thu, 30 Jul 2020 02:15:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A2A933844041 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1596075328; bh=U+bsnppDYIkxIjWD2LlIcV4ZjjAsO7ULRBGFF2bkwhQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DVcwrnx7p0a9CMRxkT1A7zV3zCIiwgh1O5dgB1jNAy3DkjIqJU6qi4wlYkw3om0gd cSB3wzmO30JgcqCN3cfyDEGnSJjZz80+v9OerXi3ah2dJDMHmbblX/jLOcxZsi1Bm+ F7AnrVI4KHpGjnO0h0ubO3L+yTKTG4Q1Z7DmtINQ= 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: Thu, 30 Jul 2020 02:15:28 +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: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: Thu, 30 Jul 2020 02:15:28 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D64194 --- Comment #11 from CVS Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:2c58f5cadfac338a67723fd6e41c9097760c4a33 commit r11-2420-g2c58f5cadfac338a67723fd6e41c9097760c4a33 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.=