diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-11-25 03:18:57 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-11-25 03:18:57 +0000 |
commit | 0e38d5d6775a26f8f39df353e34b0dc14c2d6cfc (patch) | |
tree | 4e4f3bf9a404a386e69243f44bb756f2393ea736 /test/Analysis/method-call.cpp | |
parent | 8ed119f7cb73fcbf44df0240203a3194e52a79d0 (diff) |
handle CXXFunctionalCastExpr in visitLValue and Environment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120143 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/method-call.cpp')
-rw-r--r-- | test/Analysis/method-call.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Analysis/method-call.cpp b/test/Analysis/method-call.cpp index 6cfbda895d..8c6b9da0f4 100644 --- a/test/Analysis/method-call.cpp +++ b/test/Analysis/method-call.cpp @@ -17,3 +17,14 @@ void f1() { } } +void f2() { + const A &x = A(3); + if (x.getx() == 3) { + int *p = 0; + *p = 3; // expected-warning{{Dereference of null pointer}} + } else { + int *p = 0; + *p = 3; // no-warning + } +} + |