diff options
author | Anna Zaks <ganna@apple.com> | 2012-02-04 02:31:37 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-02-04 02:31:37 +0000 |
commit | 1efcc42c922204d6797a70d90d3c350882f3c098 (patch) | |
tree | b342fc2b14aa59051100d1af4d12bf6ac5eac6f8 /test/Analysis/self-init.m | |
parent | 1c594088415831e52db96ffd700cf79e274a8f91 (diff) | |
download | clang-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.m | 20 |
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 |