blob: 53b22d6989310547bed99715a62569a22a7ece07 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
Douglas Gregor72de6672009-01-08 20:45:30 +00002struct 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