1// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fblocks -verify %s
2
3// rdar://problem/10982793
4// [p foo] in ARC creates a cleanup.
5// The plus is invalid and causes the cleanup to go unbound.
6// Don't crash.
7@interface A
8- (id) foo;
9@end
10void takeBlock(void (^)(void));
11void test0(id p) {
12  takeBlock(^{ [p foo] + p; }); // expected-error {{invalid operands to binary expression}}
13}
14
15void test1(void) {
16  __autoreleasing id p; // expected-note {{'p' declared here}}
17  takeBlock(^{ (void) p; }); // expected-error {{cannot capture __autoreleasing variable in a block}}
18}
19