2012-04-07 02:12:22 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -Wparentheses -Wno-objc-root-class %s
|
2009-11-12 08:06:05 +08:00
|
|
|
|
2011-04-30 04:30:39 +08:00
|
|
|
// Don't warn about some common ObjC idioms unless we have -Widiomatic-parentheses on.
|
2009-11-12 08:06:05 +08:00
|
|
|
// <rdar://problem/7382435>
|
|
|
|
|
|
|
|
@interface Object
|
|
|
|
- (id) init;
|
|
|
|
- (id) initWithInt: (int) i;
|
|
|
|
- (void) iterate: (id) coll;
|
|
|
|
- (id) nextObject;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation Object
|
|
|
|
- (id) init {
|
|
|
|
if (self = [self init]) {
|
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id) initWithInt: (int) i {
|
|
|
|
if (self = [self initWithInt: i]) {
|
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) iterate: (id) coll {
|
|
|
|
id cur;
|
|
|
|
while (cur = [coll nextObject]) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id) nextObject {
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
@end
|