[analyzer] Fix crash when returning C++ objects from ObjC messages-to-nil.
authorArtem Dergachev <artem.dergachev@gmail.com>
Fri, 26 Apr 2019 02:05:12 +0000 (02:05 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Fri, 26 Apr 2019 02:05:12 +0000 (02:05 +0000)
commitb591845f4b482a2aec74f121f5f03da2ebefcef4
treeb495ff810f852e39bde353bc250224a6ff192d42
parente1320b0ed06c2c5df30713816a8da6acd814568b
[analyzer] Fix crash when returning C++ objects from ObjC messages-to-nil.

the assertion is in fact incorrect: there is a cornercase in Objective-C++
in which a C++ object is not constructed with a constructor, but merely
zero-initialized. Namely, this happens when an Objective-C message is sent
to a nil and it is supposed to return a C++ object.

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

llvm-svn: 359262
clang/lib/StaticAnalyzer/Core/RegionStore.cpp
clang/test/Analysis/nil-receiver.mm [new file with mode: 0644]