Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Douglas Gregor | 72de667 | 2009-01-08 20:45:30 +0000 | [diff] [blame] | 2 | struct X { // expected-note{{previous definition is here}} |
Chris Lattner | 5153ee6 | 2009-04-25 08:47:54 +0000 | [diff] [blame] | 3 | struct X { } x; // expected-error{{nested redefinition of 'X'}} |
Douglas Gregor | 72de667 | 2009-01-08 20:45:30 +0000 | [diff] [blame] | 4 | }; |
| 5 | |
| 6 | struct Y { }; |
| 7 | void f(void) { |
| 8 | struct Y { }; // okay: this is a different Y |
| 9 | } |
| 10 | |
| 11 | struct T; |
| 12 | struct Z { |
| 13 | struct T { int x; } t; |
| 14 | struct U { int x; } u; |
| 15 | }; |
| 16 | |
| 17 | void f2(void) { |
| 18 | struct T t; |
Douglas Gregor | 04495c8 | 2009-02-24 01:23:02 +0000 | [diff] [blame] | 19 | struct U u; |
Douglas Gregor | 72de667 | 2009-01-08 20:45:30 +0000 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | |