]> granicus.if.org Git - clang/commit
[analyzer] Refer to capture field to determine if capture is reference.
authorDevin Coughlin <dcoughlin@apple.com>
Sun, 15 Nov 2015 03:07:17 +0000 (03:07 +0000)
committerDevin Coughlin <dcoughlin@apple.com>
Sun, 15 Nov 2015 03:07:17 +0000 (03:07 +0000)
commitb7eb8fca818d90ff076c741b106c6c90533969d6
tree9780971d3d1a5378ee6f8d5fe1d1622b589c86e8
parentec59abb84f56aa698feecfc0b426d68115983fff
[analyzer] Refer to capture field to determine if capture is reference.

The analyzer incorrectly treats captures as references if either the original
captured variable is a reference or the variable is captured by reference.
This causes the analyzer to crash when capturing a reference type by copy
(PR24914). Fix this by refering solely to the capture field to determine when a
DeclRefExpr for a lambda capture should be treated as a reference type.

https://llvm.org/bugs/show_bug.cgi?id=24914
rdar://problem/23524412

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253157 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/ExprEngine.cpp
test/Analysis/lambdas.cpp