xref: /llvm-project/clang/test/SemaObjC/bad-property-synthesis-crash.m (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
2
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}}
14}
15@synthesize what; // expected-note {{'what' declared here}}
16@end
17
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}}
21}
22@end
23