blob: 6a19921f47fa532e259033e1fa8af2404b8b52d5 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Douglas Gregor72de6672009-01-08 20:45:30 +00002struct X { // expected-note{{previous definition is here}}
Eli Friedman721e77d2009-12-07 00:22: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