diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-06-03 06:23:18 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-06-03 06:23:18 +0000 |
commit | 41cdf585c2f9cbb6652f260e05429458b23dafad (patch) | |
tree | f3b95093959d66da3f4fbf7d0b35a74c548e4fe3 /clang/test/Analysis/reference.cpp | |
parent | 3b7294777ca0184603b0da2f055e271f3758cf86 (diff) | |
download | bcm5719-llvm-41cdf585c2f9cbb6652f260e05429458b23dafad.tar.gz bcm5719-llvm-41cdf585c2f9cbb6652f260e05429458b23dafad.zip |
CFG: add all LHS of assingments as lvalue. This improves support for C++ reference. Patch by Jordy.
llvm-svn: 105383
Diffstat (limited to 'clang/test/Analysis/reference.cpp')
-rw-r--r-- | clang/test/Analysis/reference.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/Analysis/reference.cpp b/clang/test/Analysis/reference.cpp index 54d7cf57e0c..6b962157da7 100644 --- a/clang/test/Analysis/reference.cpp +++ b/clang/test/Analysis/reference.cpp @@ -9,3 +9,18 @@ void f1() { if (b != 3) *p = 1; // no-warning } + +char* ptr(); +char& ref(); + +// These next two tests just shouldn't crash. +char t1 () { + ref() = 'c'; + return '0'; +} + +// just a sanity test, the same behavior as t1() +char t2 () { + *ptr() = 'c'; + return '0'; +} |