Allow resolving headers from a PCH even after headers+PCH were moved to another path.
[clang.git] / test / FixIt / fixit-objc.m
blobbf704c66a0275679e834ee26fd0b2bc3df03612b
1 // RUN: %clang_cc1 -pedantic -verify %s
2 // RUN: cp %s %t
3 // RUN: not %clang_cc1 -pedantic -fixit -x objective-c %t
4 // RUN: %clang_cc1 -pedantic -Werror -x objective-c %t
6 /* This is a test of the various code modification hints that are
7    provided as part of warning or extension diagnostics. All of the
8    warnings will be fixed by -fixit, and the resulting file should
9    compile cleanly with -Werror -pedantic. */
11 @protocol X;
13 void foo() {
14   <X> *P;    // expected-warning{{protocol qualifiers without 'id' is archaic}}
17 @class A;
18 @class NSString;
20 @interface Test
21 - (void)test:(NSString *)string; // expected-note{{passing argument to parameter 'string' here}}
23 @property (copy) NSString *property;
24 @end
26 void g(NSString *a); // expected-note{{passing argument to parameter 'a' here}}
27 void h(id a); // expected-note 2{{passing argument to parameter 'a' here}}
29 void f(Test *t) {
30   NSString *a = "Foo"; // expected-warning {{incompatible pointer types initializing 'NSString *' with an expression of type 'char [4]'}}
31   id b = "Foo"; // expected-warning {{incompatible pointer types initializing 'id' with an expression of type 'char [4]'}}
32   g("Foo"); // expected-warning{{incompatible pointer types passing 'char [4]' to parameter of type 'NSString *'}}
33   h("Foo"); // expected-warning{{incompatible pointer types passing 'char [4]' to parameter of type 'id'}}
34   h(("Foo")); // expected-warning{{incompatible pointer types passing 'char [4]' to parameter of type 'id'}}
35   [t test:"Foo"]; // expected-warning{{incompatible pointer types sending 'char [4]' to parameter of type 'NSString *'}}
36   t.property = "Foo"; // expected-warning{{incompatible pointer types assigning to 'NSString *' from 'char [4]'}}
38   // <rdar://problem/6896493>
39   [t test:@"Foo"]]; // expected-error{{extraneous ']' before ';'}}
40   g(@"Foo")); // expected-error{{extraneous ')' before ';'}}