aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorMartin Uecker <uecker@tugraz.at>2024-05-18 22:00:04 +0200
committerMartin Uecker <uecker@tugraz.at>2024-06-18 12:51:01 +0200
commitc9b96a68860bfdee49d40b4a844af7c5ef69cd12 (patch)
treef60834a1db4b63494ff04765c7f9ae2735e0e8df /gcc/expr.cc
parente17114f99c9ea754787573679b3b4d2b52434b61 (diff)
downloadgcc-c9b96a68860bfdee49d40b4a844af7c5ef69cd12.zip
gcc-c9b96a68860bfdee49d40b4a844af7c5ef69cd12.tar.gz
gcc-c9b96a68860bfdee49d40b4a844af7c5ef69cd12.tar.bz2
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 <uecker@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.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions