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 { |
| 8 | struct Point top_left, bottom_right; |
| 9 | }; |
| 10 | |
| 11 | enum Color { Red, Green, Blue }; |
| 12 | |
| 13 | struct Window { |
| 14 | struct Rectangle bounds; |
| 15 | enum Color color; |
| 16 | }; |
| 17 | |
| 18 | struct Window window = { |
| 19 | .bunds. // expected-error{{field designator 'bunds' does not refer to any field in type 'struct Window'; did you mean 'bounds'?}} |
| 20 | topleft.x = 3.14, // expected-error{{field designator 'topleft' does not refer to any field in type 'struct Rectangle'; did you mean 'top_left'?}} |
| 21 | 2.71818, 5.0, 6.0, Red |
| 22 | }; |