https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125848

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <[email protected]>:

https://gcc.gnu.org/g:eed9f52920aa362866eab84886dc47b0a38944b0

commit r17-4658-geed9f52920aa362866eab84886dc47b0a38944b0
Author: Jakub Jelinek <[email protected]>
Date:   Fri Sep 25 17:52:22 2026 +0200

    c++: Implement C++26 P3769R1 - Clarification of placement new deallocation
as a DR [PR125848]

    The following patch implements the P3769R1 paper as a DR, changes
    the algorithm to select placement deallocation function among those
    which were looked up.

    The delete cases mentioned in the paper work differently in GCC because
    we implement one possible resolution of still pending CWG901.

    2026-09-25  Jakub Jelinek  <[email protected]>

            P3769R1
            PR c++/125848
            * call.cc (build_op_delete_call_1): Implement C++26
            P3769R1 - Clarification of placement new deallocation.  Instead of
            calling instantiate_type to select placement deallocation function
            iterate over OVERLOAD if any, perform argument deduction for
            templates, ignore candidates with different parameter type lists
            or unsatisfied constraints and if only one candidate remains,
            use it, otherwise don't destruct on throw.  Add placement_args
            argument, pass it down to build_op_delete_call call and use in
            template argument deduction.
            (build_op_delete_call): Add placement_args argument and pass it
            down to build_op_delete_call_1.
            (build_coroutine_op_delete_call): Remove placement argument, pass
            down NULL_TREE and NULL to build_op_delete_call_1 as placement and
            placement_args.
            * cp-tree.h (build_op_delete_call): Add placement_args argument.
            (build_coroutine_op_delete_call): Remove placement argument.
            * init.cc (build_new_1): Pass down *placement as placement_args
            to build_op_delete_call for placement new.
            (build_vec_delete_1): Adjust build_op_delete_call callers.
            (build_delete): Likewise.  Remove {}s around single statement
            body.
            * coroutines.cc (build_coroutine_frame_delete_expr): Don't pass
            placement to build_coroutine_op_delete_call.
            * optimize.cc (build_delete_destructor_body): Adjust
            build_op_delete_call caller.

            * g++.dg/cpp26/placement-new1.C: New test.

    Reviewed-by: Jason Merrill <[email protected]>

Reply via email to