[clang-tidy][modernize-use-starts-ends-with] Fix operator rewriting false negative...
[llvm-project.git] / clang / test / Sema / nested-redef.c
blobadc57ff4e04ab29fcfd503595b2e720714762ef6
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 struct X { // expected-note{{previous definition is here}}
3 struct X { } x; // expected-error{{nested redefinition of 'X'}}
4 };
6 struct Y { };
7 void f(void) {
8 struct Y { }; // okay: this is a different Y
11 struct T;
12 struct Z {
13 struct T { int x; } t;
14 struct U { int x; } u;
17 void f2(void) {
18 struct T t;
19 struct U u;
22 void f3(void) {
23 struct G { // expected-note{{previous definition is here}}
24 struct G {}; // expected-error{{nested redefinition of 'G'}}
28 void f4(void) {
29 struct G { // expected-note 2{{previous definition is here}}
30 struct G {}; // expected-error{{nested redefinition of 'G'}}
33 struct G {}; // expected-error{{redefinition of 'G'}}