// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,debug.ExprInspection -verify %s
// REQUIRES: LP64
voidclang_analyzer_eval(bool);intf1(char*dst){char*p = dst +4;char*q = dst +3;return!(q >= p);}longf2(char*c){returnlong(c)&1;}boolf3(){return!false;}void*f4(int*w){returnreinterpret_cast<void*&>(w);}namespace{structA{};structB{operatorA(){returnA();}};
A f(char*dst){
B b;return b;}}namespace{structS{void*p;};void*f(S*w){return&reinterpret_cast<void*&>(*w);}}namespace{structC{void*p;staticvoidf();};voidC::f(){}}voidvla(intn){int nums[n];
nums[0]=1;clang_analyzer_eval(nums[0]==1);// expected-warning{{TRUE}}
// This used to fail with MallocChecker on, and /only/ in C++ mode.
// This struct is POD, though, so it should be fine to put it in a VLA.
struct{int x;} structs[n];
structs[0].x=1;clang_analyzer_eval(structs[0].x==1);// expected-warning{{TRUE}}
}voiduseIntArray(int[]);voidtestIntArrayLiteral(){useIntArray((int[]){1,2,3});}