diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
commit | bfef399519ca9b8a4b4c6b563253bad7e0eeffe0 (patch) | |
tree | df8df0b0067b381eab470a3b8f28d14a552a6340 /test/Analysis/cxx11-crashes.cpp | |
parent | 6a0372513edbc473b538d2f724efac50405d6fef (diff) |
Diffstat (limited to 'test/Analysis/cxx11-crashes.cpp')
-rw-r--r-- | test/Analysis/cxx11-crashes.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/Analysis/cxx11-crashes.cpp b/test/Analysis/cxx11-crashes.cpp index d0b9222b6a66..3c33de33558f 100644 --- a/test/Analysis/cxx11-crashes.cpp +++ b/test/Analysis/cxx11-crashes.cpp @@ -65,3 +65,32 @@ bool begin(double *it) { 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}; +} + +// This crashed because the analyzer did not understand AttributedStmts. +void fallthrough() { + switch (1) { + case 1: + [[clang::fallthrough]]; + } +} |