| // RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,debug.ExprInspection -verify %s |
| void clang_analyzer_eval(bool); |
| return reinterpret_cast<void*&>(w); |
| operator A() { return A(); } |
| return &reinterpret_cast<void*&>(*w); |
| 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]; |
| clang_analyzer_eval(structs[0].x == 1); // expected-warning{{TRUE}} |
| void useIntArray(int []); |
| void testIntArrayLiteral() { |
| useIntArray((int []){ 1, 2, 3 }); |