From 36c49e3f258dced101949edabd72e9bc3f1dedc4 Mon Sep 17 00:00:00 2001 From: dim 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 0000000..593ba1d --- /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.1