nested-redef.c 376 B

12345678910111213141516171819202122
  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. };
  5. struct Y { };
  6. void f(void) {
  7. struct Y { }; // okay: this is a different Y
  8. }
  9. struct T;
  10. struct Z {
  11. struct T { int x; } t;
  12. struct U { int x; } u;
  13. };
  14. void f2(void) {
  15. struct T t;
  16. struct U u;
  17. }