blob: 0264ad4c58a1971241cf40bfc2dca8a212bb8a8f [file] [log] [blame]
Douglas Gregor72de6672009-01-08 20:45:30 +00001// RUN: clang -fsyntax-only -verify %s
2struct X { // expected-note{{previous definition is here}}
Chris Lattner1829a6d2009-02-23 22:00:08 +00003 struct X { } x; // expected-error{{nested redefinition of 'X'}} \
4 expected-error {{field has incomplete type}}
Douglas Gregor72de6672009-01-08 20:45:30 +00005};
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;
Douglas Gregor04495c82009-02-24 01:23:02 +000020 struct U u;
Douglas Gregor72de6672009-01-08 20:45:30 +000021}
22
23