[CFG] [analyzer] Work around a disappearing CXXBindTemporaryExpr.
authorArtem Dergachev <artem.dergachev@gmail.com>
Fri, 30 Mar 2018 19:25:39 +0000 (19:25 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Fri, 30 Mar 2018 19:25:39 +0000 (19:25 +0000)
commit6a5cd5e1cad601bfe3785654f6bbdfe81844bc07
treeb613739fb954f5424f0397ece15a36f8e46f0cf3
parentb5294a3b5934cee3196cbd5a6d69010022b8ace9
[CFG] [analyzer] Work around a disappearing CXXBindTemporaryExpr.

Sometimes template instantiation causes CXXBindTemporaryExpr to be missing in
its usual spot. In CFG, temporary destructors work by relying on
CXXBindTemporaryExprs, so they won't work in this case.

Avoid the crash and notify the clients that we've encountered an unsupported AST
by failing to provide the ill-formed construction context for the temporary.

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

llvm-svn: 328895
clang/include/clang/Analysis/ConstructionContext.h
clang/lib/Analysis/CFG.cpp
clang/lib/Analysis/ConstructionContext.cpp
clang/test/Analysis/missing-bind-temporary.cpp [new file with mode: 0644]