diff options
author | Patrick Palka <ppalka@redhat.com> | 2022-10-25 14:14:29 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2022-10-25 14:14:29 -0400 |
commit | fe1e1ae0c84d3f52f62509d164bbb117c29d9675 (patch) | |
tree | b85991cffd97f77493ac11a38a9ae2ea2e42f607 /gcc/cp/cp-tree.h | |
parent | 4a54873d7753068fe64e01efd5d8a06615bdb167 (diff) | |
download | gcc-fe1e1ae0c84d3f52f62509d164bbb117c29d9675.zip gcc-fe1e1ae0c84d3f52f62509d164bbb117c29d9675.tar.gz gcc-fe1e1ae0c84d3f52f62509d164bbb117c29d9675.tar.bz2 |
c++: remove use_default_args parm of coerce_template_parms
The parameter use_default_args of coerce_template_parms, introduced way
back in r110693, is effectively unused ever since r7-5536-g3c75aaa3d884ef
removed the last 'coerce_template_parms (..., true, false)' call. So
this patch aims to simplify this function's API by getting rid of this
parameter.
In passing, I noticed we currently define wrapper overloads of
coerce_template_parms that act as defacto default arguments for complain
and require_all_args. It seems cleaner however to just specify real
default arguments for the main overload instead. And I suppose we
should also give c_innermost_t_p the same defaults.
But I'm not sure about defaulting complain to tf_none, which is
inconsistent with how we default it in other places to either tf_error
or tf_warning_or_error (as a convenience for non-SFINAE callers). And
since in general it's probably better to not default complain as that's
a source of SFINAE bugs, and only a handful of callers use this defacto
complain=tf_none default, this patch gets rid of this complain default
(but keeps the require_all_args default).
gcc/cp/ChangeLog:
* constraint.cc (resolve_function_concept_overload): Explicitly
pass complain=tf_none to coerce_template_parms.
(resolve_concept_check): Likewise.
(normalize_concept_check): Likewise.
* cp-tree.h (coerce_template_parms): Declare the main overload
and default its last parameter to true. Remove wrapper overloads.
* pt.cc (determine_specialization): Adjust calls to
coerce_template_parms and coerce_innermost_template_parms after
removing their last parameter.
(coerce_template_args_for_ttp): Likewise.
(coerce_ttp_args_for_tta): Likewise.
(coerce_template_template_parms): Likewise.
(coerce_template_parms): Remove use_default_args parameter and
adjust function comment. Document default argument. Remove
wrapper overloads. No longer static.
(coerce_innermost_template_parms): Remove use_default_args
parameter. Default require_all_args to true.
(lookup_template_class): As with determine_specialization.
(finish_template_variable): Likewise.
(tsubst_decl): Likewise.
(instantiate_alias_template): Likewise.
(fn_type_unification): Likewise.
(resolve_overloaded_unification): Likewise.
(resolve_nondeduced_context): Likewise.
(get_partial_spec_bindings): Likewise.
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r-- | gcc/cp/cp-tree.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index cec376d..867096b 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -7468,8 +7468,8 @@ extern tree get_function_template_decl (const_tree); extern tree resolve_nondeduced_context (tree, tsubst_flags_t); extern tree resolve_nondeduced_context_or_error (tree, tsubst_flags_t); extern hashval_t iterative_hash_template_arg (tree arg, hashval_t val); -extern tree coerce_template_parms (tree, tree, tree); -extern tree coerce_template_parms (tree, tree, tree, tsubst_flags_t); +extern tree coerce_template_parms (tree, tree, tree, tsubst_flags_t, + bool = true); extern tree canonicalize_type_argument (tree, tsubst_flags_t); extern void register_local_specialization (tree, tree); extern tree retrieve_local_specialization (tree); |