Emit a specific diagnostic when typedefing C++ bool, mirroring gcc.
[clang.git] / test / FixIt / typo.c
blob01ff3a09cf3e7d8191ef2cb6d0a91a53428af415
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // 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
5 struct Point {
6 float x, y;
7 };
9 struct Rectangle {
10 struct Point top_left, // expected-note{{'top_left' declared here}}
11 bottom_right;
14 enum Color { Red, Green, Blue };
16 struct Window {
17 struct Rectangle bounds; // expected-note{{'bounds' declared here}}
18 enum Color color;
21 struct 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