c++: deduction from auto fn [PR105623]
commit850a9ce8bcca59c7efabcdeeca14c5bd905e8363
authorJason Merrill <jason@redhat.com>
Tue, 24 May 2022 21:37:58 +0000 (24 17:37 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 25 May 2022 15:09:10 +0000 (25 11:09 -0400)
tree8e9fe808f5f9be98eb1436a45df1f1376d820f5a
parent8c9c92f8079589730708ce831a86e01d510d9db4
c++: deduction from auto fn [PR105623]

Since my patch for PR90451, we defer mark_used of single functions as late
as possible.  And since my r12-1273, we keep BASELINK from lookup around
rather than reconstruct it later.  These both made us try to instantiate g
with a function type that still had 'auto' as its return type.

PR c++/105623

gcc/cp/ChangeLog:

* decl2.cc (mark_used): Copy type from fn to BASELINK.
* pt.cc (unify_one_argument): Call mark_single_function.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1y/auto-fn62.C: New test.
gcc/cp/decl2.cc
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp1y/auto-fn62.C [new file with mode: 0644]