blob: 01ff3a09cf3e7d8191ef2cb6d0a91a53428af415 [file] [log] [blame]
Douglas Gregorc171e3b2010-01-01 00:03:05 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Nick Lewyckyba5f6ec2010-04-24 01:30:46 +00002// RUN: cp %s %t
3// RUN: %clang_cc1 -fsyntax-only -fixit -x c %t || true
4// RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x c %t
Douglas Gregorc171e3b2010-01-01 00:03:05 +00005struct Point {
6 float x, y;
7};
8
9struct Rectangle {
Douglas Gregor67dd1d42010-01-07 00:17:44 +000010 struct Point top_left, // expected-note{{'top_left' declared here}}
11 bottom_right;
Douglas Gregorc171e3b2010-01-01 00:03:05 +000012};
13
14enum Color { Red, Green, Blue };
15
16struct Window {
Douglas Gregor67dd1d42010-01-07 00:17:44 +000017 struct Rectangle bounds; // expected-note{{'bounds' declared here}}
Douglas Gregorc171e3b2010-01-01 00:03:05 +000018 enum Color color;
19};
20
21struct Window window = {
22 .bunds. // expected-error{{field designator 'bunds' does not refer to any field in type 'struct Window'; did you mean 'bounds'?}}
23 topleft.x = 3.14, // expected-error{{field designator 'topleft' does not refer to any field in type 'struct Rectangle'; did you mean 'top_left'?}}
24 2.71818, 5.0, 6.0, Red
25};