]> gcc.gnu.org Git - gcc.git/commit
c++: remove '_sfinae' suffix from functions
authorPatrick Palka <ppalka@redhat.com>
Mon, 12 Sep 2022 21:55:53 +0000 (17:55 -0400)
committerPatrick Palka <ppalka@redhat.com>
Mon, 12 Sep 2022 21:55:53 +0000 (17:55 -0400)
commitc17fa0f20eb29bd1cab5e438c72b96281693ac29
tree24f21093bcdd544216dd99f5ba76ee06043d15b8
parentc3ba0eaaa223f7b8208d279e3f39ff134912f9e9
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.
12 files changed:
gcc/cp/call.cc
gcc/cp/constexpr.cc
gcc/cp/cp-tree.h
gcc/cp/cvt.cc
gcc/cp/decl.cc
gcc/cp/except.cc
gcc/cp/init.cc
gcc/cp/pt.cc
gcc/cp/semantics.cc
gcc/cp/tree.cc
gcc/cp/typeck.cc
gcc/cp/typeck2.cc
This page took 0.057561 seconds and 5 git commands to generate.