gcc/testsuite/gcc.dg/gnu17-tag-1.c
raw| 1 | /* Test "originally defined" message for struct redefinition for C17. */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-std=gnu17" } */ |
| 4 | |
| 5 | struct s { int i; }; /* { dg-message "originally defined" } */ |
| 6 | struct s { int j; }; /* { dg-error "redefinition" } */ |
| 7 | |
| 8 | void |
| 9 | f (int x) |
| 10 | { |
| 11 | struct t { int (*a)[x]; }; /* { dg-message "originally defined" } */ |
| 12 | struct t { int (*a)[x]; }; /* { dg-error "redefinition" } */ |
| 13 | } |