2018-05-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / c99-tag-2.c
blob22cf90e27d3dc8cc0695c1f5cf4d68f0b3381193
1 /* Test for handling of tags. A struct defined in an inner scope does
2 not match one declared in an outer scope. */
3 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
4 /* { dg-do compile } */
5 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
7 struct s;
8 struct t { struct s *p; } x;
10 void
11 f (void)
13 /* This is a different struct s from the outer one. */
14 struct s { int a; } y;
15 x.p = &y; /* { dg-error "incompatible" } */