xref: /aosp_15_r20/external/clang/test/Sema/nested-redef.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -fsyntax-only -verify %s
2*67e74705SXin Li struct X { // expected-note{{previous definition is here}}
3*67e74705SXin Li   struct X { } x; // expected-error{{nested redefinition of 'X'}}
4*67e74705SXin Li };
5*67e74705SXin Li 
6*67e74705SXin Li struct Y { };
f(void)7*67e74705SXin Li void f(void) {
8*67e74705SXin Li   struct Y { }; // okay: this is a different Y
9*67e74705SXin Li }
10*67e74705SXin Li 
11*67e74705SXin Li struct T;
12*67e74705SXin Li struct Z {
13*67e74705SXin Li   struct T { int x; } t;
14*67e74705SXin Li   struct U { int x; } u;
15*67e74705SXin Li };
16*67e74705SXin Li 
f2(void)17*67e74705SXin Li void f2(void) {
18*67e74705SXin Li   struct T t;
19*67e74705SXin Li   struct U u;
20*67e74705SXin Li }
21*67e74705SXin Li 
22*67e74705SXin Li 
23