aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/reference.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2010-06-03 06:23:18 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2010-06-03 06:23:18 +0000
commitfc61d94fbdbcd2b423976e21f24d423fcd442486 (patch)
tree63708ca7e7ee93f624779b3ac8f74ad95ab71f64 /test/Analysis/reference.cpp
parentb00196d19decec79c7e5ee42f423856f4436c522 (diff)
CFG: add all LHS of assingments as lvalue. This improves support for C++ reference. Patch by Jordy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105383 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/reference.cpp')
-rw-r--r--test/Analysis/reference.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Analysis/reference.cpp b/test/Analysis/reference.cpp
index 54d7cf57e0..6b962157da 100644
--- a/test/Analysis/reference.cpp
+++ b/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';
+}