]> git.ipfire.org Git - thirdparty/gcc.git/commit
c: fix ICE with enum completed with packed attribute after forward decl [PR116892]
authorMartin Uecker <uecker@tugraz.at>
Sun, 1 Jun 2025 20:30:42 +0000 (22:30 +0200)
committerMartin Uecker <uecker@gcc.gnu.org>
Tue, 3 Jun 2025 16:41:46 +0000 (18:41 +0200)
commitbd773888eafe34fb990041462df6d3a3c8a4217d
tree7f7583e4fc85efabe6b3ad155c5d137a5255f7bd
parent61fd6a338de5f8468969ce284a6435ce4e251e3e
c: fix ICE with enum completed with packed attribute after forward decl [PR116892]

After forward declaration of an enum and when completing it with the
attribute packed, we need to propagate TYPE_PACKED to all main variants.

PR c/116892

gcc/c/ChangeLog:
* c-decl.cc (finish_enum): Propagate TYPE_PACKED.

gcc/testsuite/ChangeLog:
* gcc.dg/pr116892.c: New test.
gcc/c/c-decl.cc
gcc/testsuite/gcc.dg/pr116892.c [new file with mode: 0644]