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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Marek Polacek
<mpola...@gcc.gnu.org>:

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

commit r12-9263-ga1ebe3f7f9c14e66df2ae56138c495cad33c7ee4
Author: Marek Polacek <pola...@redhat.com>
Date:   Fri Mar 10 10:14:20 2023 -0500

    c++: ICE with constexpr lambda [PR107280]

    We crash here since r10-3661, the store_init_value hunk in particular.
    Before, we called cp_fully_fold_init, so e.g.

      {.str=VIEW_CONVERT_EXPR<char[8]>("")}

    was folded into

      {.str=""}

    but now we don't fold and keep the VCE around, and it causes trouble in
    cxx_eval_store_expression: in the !refs->is_empty () loop we descend on
    .str's initializer but since it's wrapped in a VCE, we skip the STRING_CST
    check and then crash on the CONSTRUCTOR_NO_CLEARING.

            PR c++/107280

    gcc/cp/ChangeLog:

            * constexpr.cc (cxx_eval_store_expression): Strip location
wrappers.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp1z/constexpr-lambda28.C: New test.

    (cherry picked from commit be20dcc359bcc4677c5b9ce011d3cd7b4ce94a64)

Reply via email to