| 1 |
// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fblocks -Wno-objc-root-class -verify %s |
| 2 |
|
| 3 |
// [p foo] in ARC creates a cleanup. |
| 4 |
// The plus is invalid and causes the cleanup to go unbound. |
| 5 |
// Don't crash. |
| 6 |
@interface A |
| 7 |
- (id) foo; |
| 8 |
@end |
| 9 |
void takeBlock(void (^)(void)); |
| 10 |
void test0(id p) { |
| 11 |
takeBlock(^{ [p foo] + p; }); // expected-error {{invalid operands to binary expression}} |
| 12 |
} |
| 13 |
|
| 14 |
void test1(void) { |
| 15 |
__autoreleasing id p; // expected-note {{'p' declared here}} |
| 16 |
takeBlock(^{ (void) p; }); // expected-error {{cannot capture __autoreleasing variable in a block}} |
| 17 |
} |
| 18 |
|
| 19 |
@class WebFrame; |
| 20 |
@interface WebView // expected-note {{previous definition is here}} |
| 21 |
- (WebFrame *)mainFrame; |
| 22 |
@end |
| 23 |
|
| 24 |
@interface WebView // expected-error {{duplicate interface definition for class 'WebView'}} |
| 25 |
@property (nonatomic, readonly, strong) WebFrame *mainFrame; |
| 26 |
@end |
| 27 |
|
| 28 |
@interface UIWebDocumentView |
| 29 |
- (WebView *)webView; |
| 30 |
@end |
| 31 |
|
| 32 |
@interface UIWebBrowserView : UIWebDocumentView |
| 33 |
@end |
| 34 |
|
| 35 |
@interface StoreBanner @end |
| 36 |
|
| 37 |
@implementation StoreBanner |
| 38 |
+ (void)readMetaTagContentForUIWebBrowserView:(UIWebBrowserView *)browserView |
| 39 |
{ |
| 40 |
[[browserView webView] mainFrame]; |
| 41 |
} |
| 42 |
@end |