8sa1-gcc/gcc/cp
Patrick Palka 2c58f5cadf c++: overload sets and placeholder return type [PR64194]
In the testcase below, template argument deduction for the call
g(id<int>) goes wrong because the functions in the overload set id<int>
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.
2020-07-29 22:06:44 -04:00
..
call.c c++: Implement C++20 implicit move changes. [PR91427] 2020-07-29 14:24:59 -04:00
cfns.gperf
cfns.h
ChangeLog Daily bump. 2020-07-30 00:16:24 +00:00
ChangeLog-1993
ChangeLog-1994
ChangeLog-1995
ChangeLog-1996
ChangeLog-1997
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog.ptr
ChangeLog.tree-ssa
class.c c++: better fixup_type_variants 2020-07-28 09:01:31 -07:00
config-lang.in
constexpr.c
constraint.cc c++: constraints and explicit instantiation [PR96164] 2020-07-29 22:06:33 -04:00
coroutines.cc c++: Implement C++20 implicit move changes. [PR91427] 2020-07-29 14:24:59 -04:00
cp-gimplify.c c++: Set more DECL_CONTEXTs 2020-07-28 09:01:32 -07:00
cp-lang.c
cp-name-hint.h
cp-objcp-common.c c++: Set more DECL_CONTEXTs 2020-07-28 09:01:32 -07:00
cp-objcp-common.h
cp-tree.def c++: Comments & formatting 2020-07-14 06:27:07 -07:00
cp-tree.h c++: Implement C++20 implicit move changes. [PR91427] 2020-07-29 14:24:59 -04:00
cp-ubsan.c
cvt.c
cxx-pretty-print.c
cxx-pretty-print.h
decl2.c c++: More cleanups for modern C++ 2020-07-22 08:43:25 -07:00
decl.c c++: Set more DECL_CONTEXTs 2020-07-28 09:01:32 -07:00
decl.h
dump.c
error.c c++: More cleanups for modern C++ 2020-07-22 08:43:25 -07:00
except.c c++: Implement C++20 implicit move changes. [PR91427] 2020-07-29 14:24:59 -04:00
expr.c
friend.c
g++spec.c
init.c
lambda.c
lang-specs.h
lex.c
logic.cc
Make-lang.in
mangle.c c++: mangling cleanups 2020-07-22 08:43:24 -07:00
method.c c++: Comments & formatting 2020-07-14 06:27:07 -07:00
name-lookup.c c++: Comments & formatting 2020-07-14 06:27:07 -07:00
name-lookup.h
operators.def
optimize.c
parser.c c++: Fix up cp_lexer_safe_previous_token [PR96328] 2020-07-28 15:41:30 +02:00
parser.h
pt.c c++: overload sets and placeholder return type [PR64194] 2020-07-29 22:06:44 -04:00
ptree.c c++: tree dump indentation 2020-07-28 09:01:31 -07:00
rtti.c c++: Comments & formatting 2020-07-14 06:27:07 -07:00
search.c
semantics.c c++: Pseudo-destructor ends object lifetime. 2020-07-20 18:18:12 -04:00
tree.c c++: Implement C++20 implicit move changes. [PR91427] 2020-07-29 14:24:59 -04:00
type-utils.h
typeck2.c
typeck.c c++: Implement C++20 implicit move changes. [PR91427] 2020-07-29 14:24:59 -04:00
vtable-class-hierarchy.c