blob: 54a970f044212df6fd4f361be27db03e09561e07 [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}}
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