зеркало из https://github.com/microsoft/clang-1.git
Added test case for static analysis to warn about passing uninitialized values as arguments (not the receiver) in message expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48845 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
2daf5b622b
Коммит
5f67d13b3b
|
@ -1,6 +1,7 @@
|
|||
// RUN: clang -grsimple -verify %s
|
||||
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
|
||||
void f1() {
|
||||
NSString *aString;
|
||||
|
@ -11,3 +12,9 @@ void f2() {
|
|||
NSString *aString = nil;
|
||||
unsigned i = [aString length]; // no-warning
|
||||
}
|
||||
|
||||
void f3() {
|
||||
NSMutableArray *aArray = [NSArray array];
|
||||
NSString *aString;
|
||||
[aArray addObject:aString]; // expected-warning {{Pass-by-value argument in message expression is undefined.}}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче