diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-02-01 18:24:22 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-02-01 18:24:22 +0000 |
| commit | 8b6ec6870f65f4a4d4c88b2a9715706ba34ee6d9 (patch) | |
| tree | 7d265363387c5fd3dc6641e7968ec640bd96a12f /clang/test/Analysis/self-init.m | |
| parent | 5b4288440dd011062210c9f9e6ce4c50b03f4efb (diff) | |
| download | bcm5719-llvm-8b6ec6870f65f4a4d4c88b2a9715706ba34ee6d9.tar.gz bcm5719-llvm-8b6ec6870f65f4a4d4c88b2a9715706ba34ee6d9.zip | |
Warn for "if ((a == b))" where the equality expression is needlessly wrapped inside parentheses.
It's highly likely that the user intended an assignment used as condition.
Addresses rdar://8848646.
llvm-svn: 124668
Diffstat (limited to 'clang/test/Analysis/self-init.m')
| -rw-r--r-- | clang/test/Analysis/self-init.m | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/Analysis/self-init.m b/clang/test/Analysis/self-init.m index 1e16e41d7a9..1dc5aa92f9c 100644 --- a/clang/test/Analysis/self-init.m +++ b/clang/test/Analysis/self-init.m @@ -135,7 +135,7 @@ extern void *somePtr; } -(id)init13 { - if ((self == [super init])) { + if (self == [super init]) { myivar = 0; // expected-warning {{Instance variable used}} } return self; // expected-warning {{Returning 'self'}} |

