brintos

brintos / llvm-project-archived public Read only

0
0
Text · 733 B · adc57ff Raw
35 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify %s2struct X { // expected-note{{previous definition is here}}3  struct X { } x; // expected-error{{nested redefinition of 'X'}}4}; 5 6struct Y { };7void f(void) {8  struct Y { }; // okay: this is a different Y9}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;19  struct U u;20}21 22void f3(void) {23  struct G { // expected-note{{previous definition is here}}24    struct G {}; // expected-error{{nested redefinition of 'G'}}25  };26}27 28void f4(void) {29  struct G { // expected-note 2{{previous definition is here}}30    struct G {}; // expected-error{{nested redefinition of 'G'}}31  };32 33  struct G {}; // expected-error{{redefinition of 'G'}}34}35