Douglas Gregor | c171e3b | 2010-01-01 00:03:05 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Nick Lewycky | ba5f6ec | 2010-04-24 01:30:46 +0000 | [diff] [blame] | 2 | // RUN: cp %s %t |
| 3 | // RUN: %clang_cc1 -fsyntax-only -fixit -x c %t || true |
| 4 | // RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x c %t |
Douglas Gregor | c171e3b | 2010-01-01 00:03:05 +0000 | [diff] [blame] | 5 | struct Point { |
| 6 | float x, y; |
| 7 | }; |
| 8 | |
| 9 | struct Rectangle { |
Douglas Gregor | 67dd1d4 | 2010-01-07 00:17:44 +0000 | [diff] [blame] | 10 | struct Point top_left, // expected-note{{'top_left' declared here}} |
| 11 | bottom_right; |
Douglas Gregor | c171e3b | 2010-01-01 00:03:05 +0000 | [diff] [blame] | 12 | }; |
| 13 | |
| 14 | enum Color { Red, Green, Blue }; |
| 15 | |
| 16 | struct Window { |
Douglas Gregor | 67dd1d4 | 2010-01-07 00:17:44 +0000 | [diff] [blame] | 17 | struct Rectangle bounds; // expected-note{{'bounds' declared here}} |
Douglas Gregor | c171e3b | 2010-01-01 00:03:05 +0000 | [diff] [blame] | 18 | enum Color color; |
| 19 | }; |
| 20 | |
| 21 | struct Window window = { |
| 22 | .bunds. // expected-error{{field designator 'bunds' does not refer to any field in type 'struct Window'; did you mean 'bounds'?}} |
| 23 | topleft.x = 3.14, // expected-error{{field designator 'topleft' does not refer to any field in type 'struct Rectangle'; did you mean 'top_left'?}} |
| 24 | 2.71818, 5.0, 6.0, Red |
| 25 | }; |