blob: b4c52fa0d1462e0bbe880c91bb39268a3acfc050 [file] [log] [blame]
John McCallc8d8ac52009-11-12 00:06:05 +00001// RUN: clang-cc -fsyntax-only -verify %s
2
3// Don't warn about some common ObjC idioms unless we have -Wparentheses on.
4// <rdar://problem/7382435>
5
6@interface Object
7- (id) init;
8- (id) initWithInt: (int) i;
9- (void) iterate: (id) coll;
10- (id) nextObject;
11@end
12
13@implementation Object
14- (id) init {
15 if (self = [self init]) {
16 }
17 return self;
18}
19
20- (id) initWithInt: (int) i {
21 if (self = [self initWithInt: i]) {
22 }
23 return self;
24}
25
26- (void) iterate: (id) coll {
27 id cur;
28 while (cur = [coll nextObject]) {
29 }
30}
31
32- (id) nextObject {
33 return self;
34}
35@end