blob: 21aebfe3a968b0ad6dd2a9051ef93a3efd9da7f4 [file] [log] [blame]
Daniel Dunbar73dd7682009-11-14 04:39:42 +00001// RUN: clang-cc -pedantic -fixit %s -o %t
2// RUN: clang-cc -pedantic -x objective-c %t -verify
Anders Carlssonb76cd3d2009-11-10 04:46:30 +00003
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}