summaryrefslogtreecommitdiffstats
path: root/test/Analysis/stack-addr-ps.cpp
blob: 593ba1df94d34d854d378853f96088cd4b7778af (plain)
1
2
3
4
5
6
7
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}}
}
OpenPOWER on IntegriCloud