Shih-wei Liao | f8fd82b | 2010-02-10 11:10:31 -0800 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | // RUN: %clang_cc1 -fsyntax-only -fixit -o - %s | %clang_cc1 -fsyntax-only -pedantic -Werror -x c - |
| 3 | struct Point { |
| 4 | float x, y; |
| 5 | }; |
| 6 | |
| 7 | struct Rectangle { |
| 8 | struct Point top_left, // expected-note{{'top_left' declared here}} |
| 9 | bottom_right; |
| 10 | }; |
| 11 | |
| 12 | enum Color { Red, Green, Blue }; |
| 13 | |
| 14 | struct Window { |
| 15 | struct Rectangle bounds; // expected-note{{'bounds' declared here}} |
| 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 | }; |