2010-01-01 10:34:51 +00:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2010-05-04 16:12:48 +00:00
|
|
|
// RUN: cp %s %t
|
|
|
|
// RUN: %clang_cc1 -fsyntax-only -fixit -x c %t || true
|
|
|
|
// RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x c %t
|
2010-01-01 10:34:51 +00:00
|
|
|
struct Point {
|
|
|
|
float x, y;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Rectangle {
|
2010-01-15 15:39:40 +00:00
|
|
|
struct Point top_left, // expected-note{{'top_left' declared here}}
|
|
|
|
bottom_right;
|
2010-01-01 10:34:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum Color { Red, Green, Blue };
|
|
|
|
|
|
|
|
struct Window {
|
2010-01-15 15:39:40 +00:00
|
|
|
struct Rectangle bounds; // expected-note{{'bounds' declared here}}
|
2010-01-01 10:34:51 +00:00
|
|
|
enum Color color;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Window window = {
|
|
|
|
.bunds. // expected-error{{field designator 'bunds' does not refer to any field in type 'struct Window'; did you mean 'bounds'?}}
|
|
|
|
topleft.x = 3.14, // expected-error{{field designator 'topleft' does not refer to any field in type 'struct Rectangle'; did you mean 'top_left'?}}
|
|
|
|
2.71818, 5.0, 6.0, Red
|
|
|
|
};
|