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