From 41cdf585c2f9cbb6652f260e05429458b23dafad Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Thu, 3 Jun 2010 06:23:18 +0000 Subject: CFG: add all LHS of assingments as lvalue. This improves support for C++ reference. Patch by Jordy. llvm-svn: 105383 --- clang/test/Analysis/reference.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'clang/test/Analysis/reference.cpp') 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'; +} -- cgit v1.2.3