1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
4 // RUN: not %clang_cc1 -fixit -x c %t
5 // RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x c %t
12 struct Point top_left
, // expected-note{{'top_left' declared here}}
16 enum Color
{ Red
, Green
, Blue
};
19 struct Rectangle bounds
; // expected-note{{'bounds' declared here}}
23 struct Window window
= {
24 .bunds
. // expected-error{{field designator 'bunds' does not refer to any field in type 'struct Window'; did you mean 'bounds'?}}
25 // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:4-[[@LINE-1]]:9}:"bounds"
27 topleft
.x
= 3.14, // expected-error{{field designator 'topleft' does not refer to any field in type 'struct Rectangle'; did you mean 'top_left'?}}
28 // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:10}:"top_left"
29 2.71818, 5.0, 6.0, Red
33 Rectangle r1
; // expected-error{{must use 'struct' tag to refer to type 'Rectangle'}}
34 // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:3}:"struct "
37 typedef struct Rectangle Rectangle
; // expected-note{{'Rectangle' declared here}}
38 rectangle
*r2
= &r1
; // expected-error{{unknown type name 'rectangle'; did you mean 'Rectangle'?}}
39 // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:12}:"Rectangle"
42 unsinged
*ptr
= 0; // expected-error{{use of undeclared identifier 'unsinged'; did you mean 'unsigned'?}}
43 // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:11}:"unsigned"