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