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

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Uecker <[email protected]>:

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

commit r17-6033-gbdd5d55644db0f26d658c3245369982a8aa2ec74
Author: Martin Uecker <[email protected]>
Date:   Wed Nov 4 00:01:57 2026 +0100

    c: fix temporary enumerator type in redefinition [PR128335]

    During redefining an enumerated type the visible type for an
    enumerator should be the one of the previous definition, i.e. and
    "int" for enumerated types without fixed underlying type where all
    enumerators fit into "int" or otherwise the enumerated type itself.
    We used the underlying type for internal computation of the
    next value which then was visible during the redefinition, but
    the visible type should remain the enumerated type.

            PR c/128335

    gcc/c/ChangeLog:
            * c-decl.cc (build_enumerator): Fix logic.

    gcc/testsuite/ChangeLog:
            * gcc.dg/pr128335.c: New test.

Reply via email to