[cfe-commits] r48845 - /cfe/trunk/test/Analysis-Apple/uninit-msg-expr.m
Ted Kremenek
kremenek at apple.com
Wed Mar 26 15:00:11 PDT 2008
Author: kremenek
Date: Wed Mar 26 17:00:11 2008
New Revision: 48845
URL: http://llvm.org/viewvc/llvm-project?rev=48845&view=rev
Log:
Added test case for static analysis to warn about passing uninitialized values as arguments (not the receiver) in message expressions.
Modified:
cfe/trunk/test/Analysis-Apple/uninit-msg-expr.m
Modified: cfe/trunk/test/Analysis-Apple/uninit-msg-expr.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis-Apple/uninit-msg-expr.m?rev=48845&r1=48844&r2=48845&view=diff
==============================================================================
--- cfe/trunk/test/Analysis-Apple/uninit-msg-expr.m (original)
+++ cfe/trunk/test/Analysis-Apple/uninit-msg-expr.m Wed Mar 26 17:00:11 2008
@@ -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 @@
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.}}
+}
More information about the cfe-commits
mailing list