Skip to content

Commit 59d1601

Browse files
committed
Add another test case
these changes.
1 parent 17ba4a7 commit 59d1601

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clang/test/C/C23/n3037.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,3 +359,9 @@ struct alignment { // c17-error {{redefinition of 'alignment'}} \
359359
c23-error {{type 'struct alignment' has a member with an attribute which currently causes the types to be treated as though they are incompatible}}
360360
int x;
361361
};
362+
363+
// Previously, this code was silently accepted by Clang despite the
364+
// incompatible redefinitions. This is now correctly being caught.
365+
unsigned GH28586; // both-note 2 {{previous definition is here}}
366+
enum { GH28586_1 } GH28586; // both-error-re {{redefinition of 'GH28586' with a different type: 'enum (unnamed enum at {{.*}})' vs 'unsigned int'}}
367+
enum { GH28586_2 } GH28586; // both-error-re {{redefinition of 'GH28586' with a different type: 'enum (unnamed enum at {{.*}})' vs 'unsigned int'}}

0 commit comments

Comments
 (0)