blob: d36e769ed0a2cf733f61b51b4db77829d58d7773 [file] [log] [blame]
Douglas Gregorc171e3b2010-01-01 00:03:05 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Douglas Gregor736fc1b2010-01-01 17:23:17 +00002// RUN: %clang_cc1 -fsyntax-only -fixit -o - %s | %clang_cc1 -fsyntax-only -pedantic -Werror -x c -
Douglas Gregorc171e3b2010-01-01 00:03:05 +00003struct Point {
4 float x, y;
5};
6
7struct Rectangle {
8 struct Point top_left, bottom_right;
9};
10
11enum Color { Red, Green, Blue };
12
13struct Window {
14 struct Rectangle bounds;
15 enum Color color;
16};
17
18struct 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};