40 lines · plain
1// RUN: %clang_cc1 -Wobjc-multiple-method-names -x objective-c -verify %s2// RUN: %clang_cc1 -Wobjc-multiple-method-names -x objective-c -verify -fobjc-arc %s3// expected-no-diagnostics4 5@interface NSObj6 7+ (instancetype) alloc;8 9+ (_Nonnull instancetype) globalObject;10 11@end12 13@interface SelfAllocReturn: NSObj14 15- (instancetype)initWithFoo:(int)x;16 17@end18 19@interface SelfAllocReturn2: NSObj20 21- (instancetype)initWithFoo:(SelfAllocReturn *)x;22 23@end24 25@implementation SelfAllocReturn26 27- (instancetype)initWithFoo:(int)x {28 return self;29}30 31+ (instancetype) thingWithFoo:(int)x {32 return [[self alloc] initWithFoo: x];33}34 35+ (void) initGlobal {36 (void)[[self globalObject] initWithFoo: 20];37}38 39@end40