1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -std=c++11 -verify %s
8 PlotPoint
limitedFit () {
14 namespace boost
{namespace filesystem3
{
25 using filesystem3::path
;
29 void radar11487541() {
30 namespace fs
= boost::filesystem
;
35 void testFloatInitializer() {
36 const float ysize
={0.015}, xsize
={0.01};
41 template<class T
> struct addr_impl_ref
{
43 inline addr_impl_ref( T
& v
): v_( v
) {
45 inline operator T
& () const {return v_
;}
47 template<class T
> struct addressof_impl
{
48 static inline T
* f( T
& v
, long ) {
49 return reinterpret_cast<T
*>(&const_cast<char&>(reinterpret_cast<const volatile char &>(v
)));
52 template<class T
> T
* addressof( T
& v
) {
53 return addressof_impl
<T
>::f( addr_impl_ref
<T
>( v
), 0 );
55 void testRadar11487525_1(){
60 // Don't crash on CK_LValueBitCast.
61 bool begin(double *it
) {
62 typedef bool type
[25];
63 bool *a
= reinterpret_cast<type
&>(*( reinterpret_cast<char *>( it
)));
67 // Don't crash on "assuming" a ComoundVal.
68 class JSONWireProtocolInputStream
{
70 virtual ~JSONWireProtocolInputStream();
72 class JSONWireProtocolReader
{
74 JSONWireProtocolReader(JSONWireProtocolInputStream
& istream
)
75 : _istream
{istream
} {} // On evaluating a bind here,
76 // the dereference checker issues an assume on a CompoundVal.
77 ~JSONWireProtocolReader();
79 JSONWireProtocolInputStream
& _istream
;
81 class SocketWireProtocolStream
: public JSONWireProtocolInputStream
{
84 SocketWireProtocolStream stream
{};
85 JSONWireProtocolReader reader
{stream
};
88 // This crashed because the analyzer did not understand AttributedStmts.
92 [[clang::fallthrough
]]; // expected-error {{does not directly precede}}