brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 8a1ebc7 Raw
43 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fblocks -Wno-objc-root-class -verify %s2 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 A7- (id) foo;8@end9void takeBlock(void (^)(void));10void test0(id p) {11  takeBlock(^{ [p foo] + p; }); // expected-error {{invalid operands to binary expression}}12}13 14void 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@end23 24@interface WebView  // expected-error {{duplicate interface definition for class 'WebView'}}25@property (nonatomic, readonly, strong) WebFrame *mainFrame;26@end27 28@interface UIWebDocumentView29- (WebView *)webView;30@end31 32@interface UIWebBrowserView : UIWebDocumentView33@end34 35@interface StoreBanner @end36 37@implementation StoreBanner38+ (void)readMetaTagContentForUIWebBrowserView:(UIWebBrowserView *)browserView39{40  [[browserView webView] mainFrame];41}42@end43