[analyzer] Remove pattern matching of lambda capture initializers
authorisuckatcs <65320245+isuckatcs@users.noreply.github.com>
Tue, 16 Aug 2022 07:31:24 +0000 (09:31 +0200)
committerisuckatcs <65320245+isuckatcs@users.noreply.github.com>
Mon, 22 Aug 2022 11:00:31 +0000 (13:00 +0200)
commit3c482632e64c1a3e4967db325562f2e353513abc
treef89ba7f9c48395423932ba4e2ca8217ce92ee54b
parentc860fd3f25af5a885625cd4d9a14cd52a5259b38
[analyzer] Remove pattern matching of lambda capture initializers

Prior to this patch we handled lambda captures based on their
initializer expression, which resulted in pattern matching. With
C++17 copy elision the initializer expression can be anything,
and this approach proved to be fragile and a source of crashes.
This patch removes pattern matching and only checks whether the
object is under construction or not.

Differential Revision: https://reviews.llvm.org/D131944
clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
clang/test/Analysis/lambdas.cpp