blob: 687405c7ce385f27dae7eea9de9f5004a3d91cb3 [file] [log] [blame]
Anders Carlssonb76cd3d2009-11-10 04:46:30 +00001// RUN: clang-cc -fsyntax-only -pedantic -fixit %s -o %t
2// RUN: clang-cc -fsyntax-only -pedantic -x objective-c %t -verify
3
4/* This is a test of the various code modification hints that are
5 provided as part of warning or extension diagnostics. All of the
6 warnings will be fixed by -fixit, and the resulting file should
7 compile cleanly with -Werror -pedantic. */
Chris Lattner75e36062009-04-03 18:38:42 +00008
9@protocol X;
10
11void foo() {
12 <X> *P; // should be fixed to 'id<X>'.
13}
Anders Carlssonb76cd3d2009-11-10 04:46:30 +000014
15@class A;
16@class NSString;
17
18@interface Test
19- (void)test:(NSString *)string;
20
21@property (copy) NSString *property;
22@end
23
24void g(NSString *a);
25void h(id a);
26
27void f(Test *t) {
28 NSString *a = "Foo";
29 id b = "Foo";
30 A* c = "Foo"; // expected-warning {{incompatible pointer types initializing 'char [4]', expected 'A *'}}
31 g("Foo");
32 h("Foo");
33 h(("Foo"));
34 [t test:"Foo"];
35 t.property = "Foo";
36}