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.
10 - (id) initWithInt: (int) i;
11 - (id) myInit __attribute__((objc_method_family(init)));
12 - (void) iterate: (id) coll;
14 @property unsigned uid;
17 @implementation Object
20 if (self = [self init]) {
25 - (id) initWithInt: (int) i {
26 if (self = [self initWithInt: i]) {
28 if (self.uid = 100) { // expected-warning {{using the result of an assignment as a condition without parentheses}} \
29 // expected-note {{place parentheses around the assignment to silence this warning}} \
30 // expected-note {{use '==' to turn this assignment into an equality comparison}}
37 if (self = [self myInit]) {
42 - (void) iterate: (id) coll {
44 while (cur = [coll nextObject]) {