blob: 72e3d658e7b6aef6ee3f58256e18897e81c4d83c [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 {
Douglas Gregor67dd1d42010-01-07 00:17:44 +00008 struct Point top_left, // expected-note{{'top_left' declared here}}
9 bottom_right;
Douglas Gregorc171e3b2010-01-01 00:03:05 +000010};
11
12enum Color { Red, Green, Blue };
13
14struct Window {
Douglas Gregor67dd1d42010-01-07 00:17:44 +000015 struct Rectangle bounds; // expected-note{{'bounds' declared here}}
Douglas Gregorc171e3b2010-01-01 00:03:05 +000016 enum Color color;
17};
18
19struct 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};