blob: 417b948b8fabebd49d4c38df121da009e6cb513c [file] [log] [blame]
Patrick Beardacfbe9e2012-04-06 18:12:22 +00001// RUN: %clang_cc1 -fsyntax-only -verify -Wparentheses -Wno-objc-root-class %s
John McCallb0e419e2009-11-12 00:06:05 +00002
Ted Kremenek2b2e06d2011-04-29 20:30:39 +00003// Don't warn about some common ObjC idioms unless we have -Widiomatic-parentheses on.
John McCallb0e419e2009-11-12 00:06:05 +00004// <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