blob: bbc485936770478dded4bc77d513f398e18a76f1 [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}}
Rafael Espindola01620702010-03-21 22:56:43 +00003 struct X { } x; // expected-error{{nested redefinition of 'X'}}
Douglas Gregor72de6672009-01-08 20:45:30 +00004};
5
6struct Y { };
7void f(void) {
8 struct Y { }; // okay: this is a different Y
9}
10
11struct T;
12struct Z {
13 struct T { int x; } t;
14 struct U { int x; } u;
15};
16
17void f2(void) {
18 struct T t;
Douglas Gregor04495c82009-02-24 01:23:02 +000019 struct U u;
Douglas Gregor72de6672009-01-08 20:45:30 +000020}
21
22