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