1 // RUN: %clang_cc1 -fsyntax-only -verify -Wparentheses -Wno-objc-root-class %s 2 3 // Don't warn about some common ObjC idioms unless we have -Widiomatic-parentheses 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 36