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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jakub Jelinek
<ja...@gcc.gnu.org>:

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

commit r12-9131-gc4b8949a3ad0a2259388841f3c833876a19bd2a2
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Wed Dec 21 09:05:27 2022 +0100

    openmp: Don't try to destruct DECL_OMP_PRIVATIZED_MEMBER vars [PR108180]

    DECL_OMP_PRIVATIZED_MEMBER vars are artificial vars with DECL_VALUE_EXPR
    of this->field used just during gimplification and omp lowering/expansion
    to privatize individual fields in methods when needed.
    As the following testcase shows, when not in templates, they were handled
    right, but in templates we actually called cp_finish_decl on them and
    that can result in their destruction, which is obviously undesirable,
    we should only destruct the privatized copies of them created in omp
    lowering.

    Fixed thusly.

    2022-12-21  Jakub Jelinek  <ja...@redhat.com>

            PR c++/108180
            * pt.cc (tsubst_expr): Don't call cp_finish_decl on
            DECL_OMP_PRIVATIZED_MEMBER vars.

            * testsuite/libgomp.c++/pr108180.C: New test.

    (cherry picked from commit 1119902b6c7c1c50123ed85ec1def8be4772d68c)

Reply via email to