From 3d1dcd9bfdb15c49ee34d576a065079ac5c4d29f Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Fri, 17 Sep 2010 15:54:40 +0000 Subject: Vendor import of clang r114020 (from the release_28 branch): http://llvm.org/svn/llvm-project/cfe/branches/release_28@114020 Approved by: rpaulo (mentor) --- test/Analysis/stack-addr-ps.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 test/Analysis/stack-addr-ps.cpp (limited to 'test/Analysis/stack-addr-ps.cpp') diff --git a/test/Analysis/stack-addr-ps.cpp b/test/Analysis/stack-addr-ps.cpp new file mode 100644 index 000000000000..593ba1df94d3 --- /dev/null +++ b/test/Analysis/stack-addr-ps.cpp @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -fsyntax-only -fblocks -verify %s + +// FIXME: Only the stack-address checking in Sema catches this right now, and +// the stack analyzer doesn't handle the ImplicitCastExpr (lvalue). +const int& g() { + int s; + return s; // expected-warning{{reference to stack memory associated with local variable 's' returned}} +} -- cgit v1.3