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

--- 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:6e4e6883d412ec5f4440a3385df51c90d4108227

commit r16-3721-g6e4e6883d412ec5f4440a3385df51c90d4108227
Author: Jakub Jelinek <[email protected]>
Date:   Tue Sep 9 16:44:48 2025 +0200

    c, c++: Allow &__real__ static_var in constant expressions [PR121678]

    When looking at constexpr references, I've noticed staticp handles
    COMPONENT_REFs and ARRAY_REFs (the latter if the index is INTEGER_CST),
    but not {REAL,IMAG}PART_EXPR.  I think that is incorrect and causes
    rejection of constexpr (for C++) or static const (for C) addresses
    of __real__ or __imag__ parts of static vars.

    2025-09-09  Jakub Jelinek  <[email protected]>

            PR c++/121678
            * tree.cc (staticp): Handle REALPART_EXPR and IMAGPART_EXPR.

            * g++.dg/ext/pr121678.C: New test.
            * gcc.dg/pr121678.c: New test.
  • [Bug c++/121678] &__real__ ... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to