https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118765
Bug ID: 118765
Summary: c23 tag matching broken for multiple redeclarations of
unions and typedefs
Product: gcc
Version: 14.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: himehaieto at gmail dot com
Target Milestone: ---
Created attachment 60389
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60389&action=edit
tag-matching-bugs.i
When reproducing the exact examples from n3037 (example 3), I found a couple
issues. The first is that the union example doesn't work at all when using
multiple declarations with the same members but written in a different order.
The second is that two declarations of the a typedef works, but a third (or
fourth) breaks. Tested with gcc 14.2.1 and -std=c23.
See the attached code for a reproducer, though note that it was specifically
unminimised so as to reproduce all the examples from n3037, and to test each
one at least a third time since it was noted it could still break after the
first redeclaration.