1 // RUN: %clang_cc1 -fsyntax-only -verify -Wparentheses -Wno-objc-root-class %s
3 // Don't warn about some common ObjC idioms unless we have -Widiomatic-parentheses on.
4 // <rdar://problem/7382435>
11 - (id) initWithInt: (int) i;
12 - (id) myInit __attribute__((objc_method_family(init)));
13 - (void) iterate: (id) coll;
15 @property unsigned uid;
18 @implementation Object
21 if (self = [self init]) {
26 - (id) initWithInt: (int) i {
27 if (self = [self initWithInt: i]) {
30 if (self.uid = 100) { // expected-warning {{using the result of an assignment as a condition without parentheses}} \
31 // expected-note {{place parentheses around the assignment to silence this warning}} \
32 // expected-note {{use '==' to turn this assignment into an equality comparison}}
39 if (self = [self myInit]) {
44 - (void) iterate: (id) coll {
46 while (cur = [coll nextObject]) {