gcc/testsuite/gcc.dg/c23-tag-3.c
raw| 1 | /* |
| 2 | * { dg-do compile } |
| 3 | * { dg-options "-std=c23" } |
| 4 | */ |
| 5 | |
| 6 | // conflicting types via linkage |
| 7 | |
| 8 | extern struct foo { int x; } x; |
| 9 | extern struct bar { float x; } y; |
| 10 | |
| 11 | void test(void) |
| 12 | { |
| 13 | extern struct foo { int x; } x; |
| 14 | extern struct bar { int x; } y; /* { dg-error "conflicting types" } */ |
| 15 | } |
| 16 |