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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:13669741e673fa6a7b7c8d68f992e58ecd393160

commit r13-7193-g13669741e673fa6a7b7c8d68f992e58ecd393160
Author: Jason Merrill <ja...@redhat.com>
Date:   Fri Apr 14 22:40:43 2023 -0400

    c++: constexpr aggregate destruction [PR109357]

    We were assuming that the result of evaluation of TARGET_EXPR_INITIAL would
    always be the new value of the temporary, but that's not necessarily true
    when the initializer is complex (i.e. target_expr_needs_replace).  In that
    case evaluating the initializer initializes the temporary as a side-effect.

            PR c++/109357

    gcc/cp/ChangeLog:

            * constexpr.cc (cxx_eval_constant_expression) [TARGET_EXPR]:
            Check for complex initializer.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/constexpr-dtor15.C: New test.

Reply via email to