CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
87 lines
2.3 KiB
Objective-C
87 lines
2.3 KiB
Objective-C
// RUN: %check_clang_tidy %s objc-super-self %t
|
|
|
|
@interface NSObject
|
|
- (instancetype)init;
|
|
- (instancetype)self;
|
|
@end
|
|
|
|
@interface NSObjectDerivedClass : NSObject
|
|
@end
|
|
|
|
@implementation NSObjectDerivedClass
|
|
|
|
- (instancetype)init {
|
|
return [super self];
|
|
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious invocation of 'self' in initializer; did you mean to invoke a superclass initializer? [objc-super-self]
|
|
// CHECK-FIXES: return [super init];
|
|
}
|
|
|
|
- (instancetype)initWithObject:(NSObject *)obj {
|
|
self = [super self];
|
|
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious invocation of 'self' in initializer; did you mean to invoke a superclass initializer? [objc-super-self]
|
|
// CHECK-FIXES: self = [super init];
|
|
if (self) {
|
|
// ...
|
|
}
|
|
return self;
|
|
}
|
|
|
|
#define INITIALIZE() [super self]
|
|
|
|
- (instancetype)initWithObject:(NSObject *)objc a:(int)a {
|
|
return INITIALIZE();
|
|
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious invocation of 'self' in initializer; did you mean to invoke a superclass initializer? [objc-super-self]
|
|
// CHECK-FIXES: return INITIALIZE();
|
|
}
|
|
|
|
#define INITIALIZER_IMPL() return [super self]
|
|
|
|
- (instancetype)initWithObject:(NSObject *)objc b:(int)b {
|
|
INITIALIZER_IMPL();
|
|
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: suspicious invocation of 'self' in initializer; did you mean to invoke a superclass initializer? [objc-super-self]
|
|
// CHECK-FIXES: INITIALIZER_IMPL();
|
|
}
|
|
|
|
#define INITIALIZER_METHOD self
|
|
|
|
- (instancetype)initWithObject:(NSObject *)objc c:(int)c {
|
|
return [super INITIALIZER_METHOD];
|
|
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious invocation of 'self' in initializer; did you mean to invoke a superclass initializer? [objc-super-self]
|
|
// CHECK-FIXES: return [super INITIALIZER_METHOD];
|
|
}
|
|
|
|
#define RECEIVER super
|
|
|
|
- (instancetype)initWithObject:(NSObject *)objc d:(int)d {
|
|
return [RECEIVER self];
|
|
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: suspicious invocation of 'self' in initializer; did you mean to invoke a superclass initializer? [objc-super-self]
|
|
// CHECK-FIXES: return [RECEIVER self];
|
|
}
|
|
|
|
- (instancetype)foo {
|
|
return [super self];
|
|
}
|
|
|
|
- (instancetype)bar {
|
|
return [self self];
|
|
}
|
|
|
|
@end
|
|
|
|
@interface RootClass
|
|
- (instancetype)init;
|
|
- (instancetype)self;
|
|
@end
|
|
|
|
@interface NotNSObjectDerivedClass : RootClass
|
|
@end
|
|
|
|
@implementation NotNSObjectDerivedClass
|
|
|
|
- (instancetype)init {
|
|
return [super self];
|
|
}
|
|
|
|
@end
|
|
|