diff options
author | Anna Zaks <ganna@apple.com> | 2012-10-31 01:18:26 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-10-31 01:18:26 +0000 |
commit | 3719ed248b7b7e239b1b435dd569b007aaea9d26 (patch) | |
tree | 29947ccc4e5285cd90e719efc91eaf1ce4db3395 /test/Analysis/method-call.cpp | |
parent | e63aedd0cb064fc106636ad856cc0e645e6374ce (diff) |
[analyzer]Don't invalidate const arguments when there is no
IdentifierInfo.
Ee: C++ copy constructors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167092 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 cfb6cd55ad..1a2fedda33 100644 --- a/test/Analysis/method-call.cpp +++ b/test/Analysis/method-call.cpp @@ -9,6 +9,10 @@ struct A { int getx() const { return x; } }; +struct B{ + int x; +}; + void testNullObject(A *a) { clang_analyzer_eval(a); // expected-warning{{UNKNOWN}} (void)a->getx(); // assume we know what we're doing @@ -34,3 +38,10 @@ void f4() { A x = 3; clang_analyzer_eval(x.getx() == 3); // expected-warning{{TRUE}} } + +void checkThatCopyConstructorDoesNotInvalidateObjectBeingCopied() { + B t; + t.x = 0; + B t2(t); + clang_analyzer_eval(t.x == 0); // expected-warning{{TRUE}} +} |