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

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

https://gcc.gnu.org/g:68b42e35b48d1f9254df05603c92d62f71f6d4df

commit r14-12648-g68b42e35b48d1f9254df05603c92d62f71f6d4df
Author: Jakub Jelinek <[email protected]>
Date:   Wed Apr 15 08:55:48 2026 +0200

    c++: Mark in cxx_mark_addressable DECL_VALUE_EXPR of DECL_ANON_UNION_VAR_P
too [PR124850]

    The following testcase ICEs since my PR53932 change in checking,
    because it sees address of the unnamed anon union VAR_DECL taken
    but without having TREE_ADDRESSABLE set.

    The following patch sets it during cxx_mark_addressable.  I'm wondering
    how we can get away with not marking other DECL_VALUE_EXPR cases,
    but couldn't come up with a testcase where it would be needed (e.g. for
    structured bindings, etc.).  So just doing it for anon union vars seems
    safer to me at least for now.

    2026-04-15  Jakub Jelinek  <[email protected]>

            PR c++/124850
            * typeck.cc (cxx_mark_addressable): For DECL_ANON_UNION_VAR_P vars
            also mark their DECL_VALUE_EXPR.

            * g++.dg/other/anon-union8.C: New test.

    Reviewed-by: Jason Merrill <[email protected]>
    (cherry picked from commit 8315b21457d740336295b58d04f0497329e94a67)

Reply via email to