nested-redef.c revision 1829a6db2ec19e08061f0bb2f4c52a8e5e4efaf0
1// RUN: clang -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  // FIXME: this is well-formed, but Clang breaks on it struct U u;
21}
22
23
24