1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -std=c++11 -verify %s
3 // radar://11485149, PR12871
8 PlotPoint
limitedFit () {
14 // radar://11487541, NamespaceAlias
15 namespace boost
{namespace filesystem3
{
26 using filesystem3::path
;
30 void radar11487541() {
31 namespace fs
= boost::filesystem
;
35 // PR12873 radar://11499139
36 void testFloatInitializer() {
37 const float ysize
={0.015}, xsize
={0.01};
41 // PR12874, radar://11487525
42 template<class T
> struct addr_impl_ref
{
44 inline addr_impl_ref( T
& v
): v_( v
) {
46 inline operator T
& () const {return v_
;}
48 template<class T
> struct addressof_impl
{
49 static inline T
* f( T
& v
, long ) {
50 return reinterpret_cast<T
*>(&const_cast<char&>(reinterpret_cast<const volatile char &>(v
)));
53 template<class T
> T
* addressof( T
& v
) {
54 return addressof_impl
<T
>::f( addr_impl_ref
<T
>( v
), 0 );
56 void testRadar11487525_1(){
61 // radar://11487525 Don't crash on CK_LValueBitCast.
62 bool begin(double *it
) {
63 typedef bool type
[25];
64 bool *a
= reinterpret_cast<type
&>(*( reinterpret_cast<char *>( it
)));
68 // radar://14164698 Don't crash on "assuming" a ComoundVal.
69 class JSONWireProtocolInputStream
{
71 virtual ~JSONWireProtocolInputStream();
73 class JSONWireProtocolReader
{
75 JSONWireProtocolReader(JSONWireProtocolInputStream
& istream
)
76 : _istream
{istream
} {} // On evaluating a bind here,
77 // the dereference checker issues an assume on a CompoundVal.
78 ~JSONWireProtocolReader();
80 JSONWireProtocolInputStream
& _istream
;
82 class SocketWireProtocolStream
: public JSONWireProtocolInputStream
{
85 SocketWireProtocolStream stream
{};
86 JSONWireProtocolReader reader
{stream
};
89 // This crashed because the analyzer did not understand AttributedStmts.
93 [[clang::fallthrough
]]; // expected-error {{does not directly precede}}