nested-redef.c revision 721e77db41cd9a07d2e1c9fdf08a4bd2eee1bc98
1// RUN: clang-cc -fsyntax-only -verify %s
2struct X { // expected-note{{previous definition is here}}
3  struct X { } x; // expected-error{{nested redefinition of 'X'}} \
4                  // expected-error{{field has incomplete type}}
5};
6
7struct Y { };
8void f(void) {
9  struct Y { }; // okay: this is a different Y
10}
11
12struct T;
13struct Z {
14  struct T { int x; } t;
15  struct U { int x; } u;
16};
17
18void f2(void) {
19  struct T t;
20  struct U u;
21}
22
23
24