summaryrefslogtreecommitdiff
path: root/test/Analysis/self-init.m
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-02-04 02:31:37 +0000
committerAnna Zaks <ganna@apple.com>2012-02-04 02:31:37 +0000
commit1efcc42c922204d6797a70d90d3c350882f3c098 (patch)
treeb342fc2b14aa59051100d1af4d12bf6ac5eac6f8 /test/Analysis/self-init.m
parent1c594088415831e52db96ffd700cf79e274a8f91 (diff)
downloadclang-1efcc42c922204d6797a70d90d3c350882f3c098.tar.gz
[analyzer] Minor cleanups to the ObjCSelfInitChecker.
(Also renames in other ObjC checkers to create one category of checks.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149745 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/self-init.m')
-rw-r--r--test/Analysis/self-init.m20
1 files changed, 18 insertions, 2 deletions
diff --git a/test/Analysis/self-init.m b/test/Analysis/self-init.m
index 019fdcd0c2..c79aa0ada4 100644
--- a/test/Analysis/self-init.m
+++ b/test/Analysis/self-init.m
@@ -147,13 +147,29 @@ static id _commonInit(MyObj *self) {
}
-(id)init14 {
- if (!(self = [super init]))
- return 0;
if (!(self = _commonInit(self)))
return 0;
return self;
}
+-(id)init15 {
+ if (!(self = [super init]))
+ return 0;
+ return self;
+}
+
+-(id)init16 {
+ somePtr = [super init];
+ self = somePtr;
+ myivar = 0;
+ return self;
+}
+
+-(id)init17 {
+ somePtr = [super init];
+ myivar = 0; // expected-warning {{Instance variable used}}
+}
+
-(void)doSomething {}
@end