Avoid double substitution with complete explicit template arguments.
authorJason Merrill <jason@redhat.com>
Tue, 13 Nov 2018 04:47:20 +0000 (23:47 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 13 Nov 2018 04:47:20 +0000 (23:47 -0500)
commit7d119905abdf28f56486be0ca01a42f8efcea1a2
treeea8bf50fae9497d15cbee4407a37515b686e65af
parent7c23c87c93f3eafa5c22d1f4f52711d97f3a4329
Avoid double substitution with complete explicit template arguments.

Previously, when we got a function template with explicit arguments for all
of the template parameters, we still did "deduction", which of course
couldn't deduce anything, but did other deduction-time checking of
non-dependent conversions and such.  This broke down with the unevaluated
lambdas patch (to follow): substituting into the lambda multiple times, once
to get the function type for deduction and then again to generate the actual
decl, doesn't work, since different substitutions of a lambda produce
different types.  I believe that skipping the initial substitution when we
have all the arguments is still conformant, and produces better diagnostics
for some testcases.

* pt.c (fn_type_unification): If we have a full set of explicit
arguments, go straight to substitution.

From-SVN: r266055
gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp0x/decltype48.C
gcc/testsuite/g++.dg/cpp0x/diag1.C
gcc/testsuite/g++.dg/cpp0x/error4.C
gcc/testsuite/g++.dg/cpp0x/pr77655.C
gcc/testsuite/g++.dg/diagnostic/param-type-mismatch-2.C
gcc/testsuite/g++.dg/diagnostic/param-type-mismatch.C