Follow through references to catch returned stack addresses, local blocks, label...
commita7dffe56cfe77e23fee04d55ef563ece45cc1288
authorArgiris Kirtzidis <akyrtzi@gmail.com>
Tue, 30 Nov 2010 22:57:32 +0000 (30 22:57 +0000)
committerArgiris Kirtzidis <akyrtzi@gmail.com>
Tue, 30 Nov 2010 22:57:32 +0000 (30 22:57 +0000)
tree8792e217ea88742c9d17724b5c2dbf11e5062837
parent8e197b4d8bab09c1ba7b43d9334a7bce7744b04f
Follow through references to catch returned stack addresses, local blocks, label addresses or references to temporaries, e.g:

const int& g2() {
  int s1;
  int &s2 = s1; // expected-note {{binding reference variable 's2' here}}
  return s2; // expected-warning {{reference to stack memory associated with local variable 's1' returned}}
}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120483 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaChecking.cpp
test/Analysis/stack-addr-ps.cpp
test/SemaCXX/address-of-temporary.cpp
test/SemaCXX/rval-references.cpp