1 // RUN: %clang_cc1 -analyze -analyzer-checker=core -std=c++11 -verify %s
2 // expected-no-diagnostics
4 // radar://11485149, PR12871
9 PlotPoint limitedFit () {
15 // radar://11487541, NamespaceAlias
16 namespace boost {namespace filesystem3 {
27 using filesystem3::path;
31 void radar11487541() {
32 namespace fs = boost::filesystem;
36 // PR12873 radar://11499139
37 void testFloatInitializer() {
38 const float ysize={0.015}, xsize={0.01};
42 // PR12874, radar://11487525
43 template<class T> struct addr_impl_ref {
45 inline addr_impl_ref( T & v ): v_( v ) {
47 inline operator T& () const {return v_;}
49 template<class T> struct addressof_impl {
50 static inline T * f( T & v, long ) {
51 return reinterpret_cast<T*>(&const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
54 template<class T> T * addressof( T & v ) {
55 return addressof_impl<T>::f( addr_impl_ref<T>( v ), 0 );
57 void testRadar11487525_1(){
62 // radar://11487525 Don't crash on CK_LValueBitCast.
63 bool begin(double *it) {
64 typedef bool type[25];
65 bool *a = reinterpret_cast<type &>(*( reinterpret_cast<char *>( it )));
69 // radar://14164698 Don't crash on "assuming" a ComoundVal.
70 class JSONWireProtocolInputStream {
72 virtual ~JSONWireProtocolInputStream();
74 class JSONWireProtocolReader {
76 JSONWireProtocolReader(JSONWireProtocolInputStream& istream)
77 : _istream{istream} {} // On evaluating a bind here,
78 // the dereference checker issues an assume on a CompoundVal.
79 ~JSONWireProtocolReader();
81 JSONWireProtocolInputStream& _istream;
83 class SocketWireProtocolStream : public JSONWireProtocolInputStream {
86 SocketWireProtocolStream stream{};
87 JSONWireProtocolReader reader{stream};
90 // This crashed because the analyzer did not understand AttributedStmts.
94 [[clang::fallthrough]];