diff options
author | Patrick Palka <ppalka@redhat.com> | 2022-09-12 17:55:53 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2022-09-12 17:55:53 -0400 |
commit | c17fa0f20eb29bd1cab5e438c72b96281693ac29 (patch) | |
tree | 24f21093bcdd544216dd99f5ba76ee06043d15b8 /gcc/cp/except.cc | |
parent | c3ba0eaaa223f7b8208d279e3f39ff134912f9e9 (diff) | |
download | gcc-c17fa0f20eb29bd1cab5e438c72b96281693ac29.zip gcc-c17fa0f20eb29bd1cab5e438c72b96281693ac29.tar.gz gcc-c17fa0f20eb29bd1cab5e438c72b96281693ac29.tar.bz2 |
c++: remove '_sfinae' suffix from functions
The functions
abstract_virtuals_error
cxx_constant_value
get_target_expr
instantiate_non_dependent_expr
require_complete_type
are each just a non-SFINAE-enabled wrapper for the corresponding
SFINAE-enabled version that's suffixed by '_sfinae'. But this suffix is
at best redundant since a 'complain' parameter already broadly conveys
that a function is SFINAE-enabled, and having two such versions of a
function is less concise than just using a default argument for 'complain'
(and arguably no less mistake prone).
So this patch squashes the two versions of each of the above functions
by adding a default 'complain' argument to the SFINAE-enabled version
whose '_sfinae' suffix we then remove.
gcc/cp/ChangeLog:
* call.cc (build_conditional_expr): Adjust calls to
'_sfinae'-suffixed functions.
(build_temp): Likewise.
(convert_like_internal): Likewise.
(convert_arg_to_ellipsis): Likewise.
(build_over_call): Likewise.
(build_cxx_call): Likewise.
(build_new_method_call): Likewise.
* constexpr.cc (cxx_eval_outermost_constant_expr): Likewise.
(cxx_constant_value_sfinae): Rename to ...
(cxx_constant_value): ... this. Document its default arguments.
(fold_non_dependent_expr): Adjust function comment.
* cp-tree.h (instantiate_non_dependent_expr_sfinae): Rename to ...
(instantiate_non_dependent_expr): ... this. Give its 'complain'
parameter a default argument.
(get_target_expr_sfinae, get_target_expr): Likewise.
(require_complete_type_sfinae, require_complete_type): Likewise.
(abstract_virtuals_error_sfinae, abstract_virtuals_error):
Likewise.
(cxx_constant_value_sfinae, cxx_constant_value): Likewise.
* cvt.cc (build_up_reference): Adjust calls to '_sfinae'-suffixed
functions.
(ocp_convert): Likewise.
* decl.cc (build_explicit_specifier): Likewise.
* except.cc (build_noexcept_spec): Likewise.
* init.cc (build_new_1): Likewise.
* pt.cc (expand_integer_pack): Likewise.
(instantiate_non_dependent_expr_internal): Adjust function
comment.
(instantiate_non_dependent_expr): Rename to ...
(instantiate_non_dependent_expr_sfinae): ... this. Document its
default argument.
(tsubst_init): Adjust calls to '_sfinae'-suffixed functions.
(fold_targs_r): Likewise.
* semantics.cc (finish_compound_literal): Likewise.
(finish_decltype_type): Likewise.
(cp_build_bit_cast): Likewise.
* tree.cc (build_cplus_new): Likewise.
(get_target_expr): Rename to ...
(get_target_expr_sfinae): ... this. Document its default
argument.
* typeck.cc (require_complete_type): Rename to ...
(require_complete_type_sfinae): ... this. Document its default
argument.
(cp_build_array_ref): Adjust calls to '_sfinae'-suffixed
functions.
(convert_arguments): Likewise.
(cp_build_binary_op): Likewise.
(build_static_cast_1): Likewise.
(cp_build_modify_expr): Likewise.
(convert_for_initialization): Likewise.
* typeck2.cc (abstract_virtuals_error): Rename to ...
(abstract_virtuals_error_sfinae): ... this. Document its default
argument.
(build_functional_cast_1): Adjust calls to '_sfinae'-suffixed
functions.
Diffstat (limited to 'gcc/cp/except.cc')
-rw-r--r-- | gcc/cp/except.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/except.cc b/gcc/cp/except.cc index da0a65c..7fdbc74 100644 --- a/gcc/cp/except.cc +++ b/gcc/cp/except.cc @@ -1256,7 +1256,7 @@ build_noexcept_spec (tree expr, tsubst_flags_t complain) && !instantiation_dependent_expression_p (expr)) { expr = build_converted_constant_bool_expr (expr, complain); - expr = instantiate_non_dependent_expr_sfinae (expr, complain); + expr = instantiate_non_dependent_expr (expr, complain); expr = cxx_constant_value (expr); } if (TREE_CODE (expr) == INTEGER_CST) |