[CFG] [analyzer] pr41142: C++17: Skip transparent InitListExprs in constructors.
authorArtem Dergachev <artem.dergachev@gmail.com>
Thu, 21 Mar 2019 00:15:07 +0000 (00:15 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Thu, 21 Mar 2019 00:15:07 +0000 (00:15 +0000)
commitaa40315c69fb667c070293ea94f6caaf4a0a6ec6
tree78b67bc379605102073514154a02c0af3841283e
parentf1d87f8b4c430d72e7ab07e13508336a7841c3e6
[CFG] [analyzer] pr41142: C++17: Skip transparent InitListExprs in constructors.

When searching for construction contexts, i.e. figuring out which statements
define the object that is constructed by each construct-expression, ignore
transparent init-list expressions because they don't add anything to the
context. This allows the Static Analyzer to model construction, destruction,
materialization, lifetime extension correctly in more cases. Also fixes
a crash caused by incorrectly evaluating initial values of variables
initialized with such expressions.

Differential Revision: https://reviews.llvm.org/D59573

llvm-svn: 356634
clang/lib/Analysis/CFG.cpp
clang/test/Analysis/cfg-rich-constructors.cpp
clang/test/Analysis/initializer.cpp