xref: /llvm-project/clang/test/FixIt/fixit-objc-arc.m (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1// RUN: %clang_cc1 -pedantic -verify %s
2// RUN: cp %s %t
3// RUN: not %clang_cc1 -pedantic -fobjc-arc -fixit -x objective-c %t
4// RUN: %clang_cc1 -pedantic -fobjc-arc -Werror -x objective-c %t
5
6@class A;
7@class NSString;
8
9@interface Test
10- (void)test:(NSString *)string;
11
12@property (copy) NSString *property;
13@end
14
15void g(NSString *a);
16void h(id a);
17
18void f(Test *t) {
19  NSString *a = "Foo"; // expected-error {{string literal must be prefixed by '@'}}
20  g("Foo"); // expected-error {{string literal must be prefixed by '@'}}
21  [t test:"Foo"]; // expected-error {{string literal must be prefixed by '@'}}
22  t.property = "Foo"; // expected-error {{string literal must be prefixed by '@'}}
23}
24