[analyzer] Do not create a CompoundVal for lvalue InitListExprs.
These should be treated like scalars. This fixes a crash reported in radar://14164698.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184257 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Analysis/cxx11-crashes.cpp b/test/Analysis/cxx11-crashes.cpp
index d0b9222..a2b70db 100644
--- a/test/Analysis/cxx11-crashes.cpp
+++ b/test/Analysis/cxx11-crashes.cpp
@@ -65,3 +65,24 @@
bool *a = reinterpret_cast<type &>(*( reinterpret_cast<char *>( it )));
return *a;
}
+
+// radar://14164698 Don't crash on "assuming" a ComoundVal.
+class JSONWireProtocolInputStream {
+public:
+ virtual ~JSONWireProtocolInputStream();
+};
+class JSONWireProtocolReader {
+public:
+ JSONWireProtocolReader(JSONWireProtocolInputStream& istream)
+ : _istream{istream} {} // On evaluating a bind here,
+ // the dereference checker issues an assume on a CompoundVal.
+~JSONWireProtocolReader();
+private:
+JSONWireProtocolInputStream& _istream;
+};
+class SocketWireProtocolStream : public JSONWireProtocolInputStream {
+};
+void test() {
+ SocketWireProtocolStream stream{};
+ JSONWireProtocolReader reader{stream};
+}
\ No newline at end of file