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

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

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

commit r15-1394-gc9b96a68860bfdee49d40b4a844af7c5ef69cd12
Author: Martin Uecker <uec...@tugraz.at>
Date:   Sat May 18 22:00:04 2024 +0200

    c23: Fix for redeclared enumerator initialized with different type
[PR115109]

    c23 specifies that the type of a redeclared enumerator is the one of the
    previous declaration.  Convert initializers with different type accordingly
    and emit an error when the value does not fit.

            2024-06-01 Martin Uecker  <uec...@tugraz.at>

            PR c/115109

    gcc/c/
            * c-decl.cc (build_enumerator): When redeclaring an
            enumerator convert value to previous type.  For redeclared
            enumerators use underlying type for computing the next value.

    gcc/testsuite/
            * gcc.dg/pr115109.c: New test.
            * gcc.dg/c23-tag-enum-6.c: New test.
            * gcc.dg/c23-tag-enum-7.c: New test.

Reply via email to