John McCall | 1e5bc4f | 2012-03-08 22:00:17 +0000 | [diff] [blame^] | 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 | ||||
10 | void takeBlock(void (^)(void)); | ||||
11 | void test0(id p) { | ||||
12 | takeBlock(^{ [p foo] + p; }); // expected-error {{invalid operands to binary expression}} | ||||
13 | } |