]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: use conversion_obstack_sentinel throughout
authorPatrick Palka <ppalka@redhat.com>
Tue, 5 Sep 2023 14:17:44 +0000 (10:17 -0400)
committerPatrick Palka <ppalka@redhat.com>
Tue, 5 Sep 2023 14:17:44 +0000 (10:17 -0400)
commitad82d19d6a66d7b28e9e181d6d55404802a77784
tree1b3a6ec8efe16879b5106e008ab3e572459f229e
parentd820cd785bd6b832ce5cadc177e2b212d349395c
c++: use conversion_obstack_sentinel throughout

This replaces direct calls to conversion_obstack_alloc(0) and obstack_free
with the recently added conversion_obstack_sentinel.  In passing, I
noticed build_user_type_conversion and build_operator_new_call don't
free their conversion_obstack allocations, so this patch also uses this
SFINAE helper in those two entry points.

gcc/cp/ChangeLog:

* call.cc (build_user_type_conversion): Free allocated
conversions.
(build_converted_constant_expr_internal): Use
conversion_obstack_sentinel instead.
(perform_dguide_overload_resolution): Likewise.
(build_new_function_call): Likewise.
(build_operator_new_call): Free allocated conversions.
(build_op_call): Use conversion_obstack_sentinel instead.
(build_conditional_expr): Use conversion_obstack_sentinel
instead, and hoist it out to the outermost scope.
(build_new_op): Use conversion_obstack_sentinel instead
and set it up before the first goto.  Remove second unneeded goto.
(build_op_subscript): Use conversion_obstack_sentinel instead.
(ref_conv_binds_to_temporary): Likewise.
(build_new_method_call): Likewise.
(can_convert_arg): Likewise.
(can_convert_arg_bad): Likewise.
(perform_implicit_conversion_flags): Likewise.
(perform_direct_initialization_if_possible): Likewise.
(initialize_reference): Likewise.
gcc/cp/call.cc