xref: /illumos-gate/usr/src/tools/smatch/src/validation/struct-ns1.c (revision f52943a93040563107b95bccb9db87d9971ef47d)
1 // This actually isn't allowed in C99, but sparse and gcc will take it:
2 enum Foo;
3 
4 static void
5 f (void)
6 {
7   enum Foo *pefoo;         // Pointer to incomplete type
8   struct Foo;              // Forward declaration
9   struct Foo *psfoo;       // Pointer to incomplete type
10   {
11     struct Foo { int foo; }; // Local definition.
12     struct Foo foo;          // variable declaration.
13     foo.foo = 1;
14   }
15 }
16 
17 enum Foo { FOO };
18 /*
19  * check-name: struct namespaces #1
20  */
21