[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaObjC / bad-property-synthesis-crash.m
bloba5945c2fe6364f64b577c3f8e37c5123ad444043
1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
3 @interface Foo
4 @property (nonatomic, retain) NSString* what; // expected-error {{unknown type name 'NSString'}} \
5                                               // expected-error {{property with}} \
6                                               // expected-note {{previous definition is here}}
7 @end
8  
9 @implementation Foo
10 - (void) setWhat: (NSString*) value { // expected-error {{expected a type}} \
11                                       // expected-warning {{conflicting parameter types in implementation of}}
12   __what; // expected-error {{use of undeclared identifier}} \
13           // expected-warning {{expression result unused}}
15 @synthesize what; // expected-note {{'what' declared here}}
16 @end
18 @implementation Bar // expected-warning {{cannot find interface declaration for}}
19 - (NSString*) what { // expected-error {{expected a type}}
20   return __what; // expected-error {{use of undeclared identifier}}
22 @end