[analyzer] pr37688: Fix a crash upon evaluating a deleted destructor of a union.
authorArtem Dergachev <artem.dergachev@gmail.com>
Fri, 18 Jan 2019 23:05:07 +0000 (23:05 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Fri, 18 Jan 2019 23:05:07 +0000 (23:05 +0000)
commit097a0497400f25c7c296feba0d148523bd37f29e
tree5541615ae38b91ad4517f57c7e83adcc02a25da4
parentc2c47f24f53a064d141eb5ea62ecd76d636edf77
[analyzer] pr37688: Fix a crash upon evaluating a deleted destructor of a union.

Add a defensive check against an invalid destructor in the CFG.

Unions with fields with destructors have their own destructor implicitly
deleted. Due to a bug in the CFG we're still trying to evaluate them
at the end of the object's lifetime and crash because we are unable
to find the destructor's declaration.

rdar://problem/47362608

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

llvm-svn: 351610
clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
clang/test/Analysis/cfg.cpp
clang/test/Analysis/unions.cpp