c++: optimize tsubst_template_decl for function templates
r14-2655-g92d1425ca78040 made instantiate_template avoid redundantly
performing a specialization lookup when calling tsubst_decl. This patch
applies the same optimization to the analagous tsubst_template_decl when
(partially) instantiating a function template. This allows us to remove
an early exit test from register_specialization since we no longer try
to register the FUNCTION_DECL corresponding to a function template
partial instantiation.
gcc/cp/ChangeLog:
* pt.cc (register_specialization): Remove now-unnecessary
early exit for FUNCTION_DECL partial instantiation.
(tsubst_template_decl): Pass use_spec_table=false to
tsubst_function_decl. Set DECL_TI_ARGS of a non-lambda
FUNCTION_DECL specialization to the full set of arguments.
Simplify register_specialization call accordingly.
gcc/testsuite/ChangeLog:
* g++.dg/template/nontype12.C: Expect two instead of three
duplicate diagnostics for A<double>::bar() specialization.