1 // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-ipa=dynamic -analyzer-config c++-stdlib-inlining=false -verify %s
2 // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-ipa=dynamic -analyzer-config c++-stdlib-inlining=true -DINLINE=1 -verify %s
4 #include "../Inputs/system-header-simulator-cxx.h"
6 void clang_analyzer_eval(bool);
8 void testVector(std::vector<int> &nums) {
9 if (nums.begin()) return;
10 if (nums.end()) return;
12 clang_analyzer_eval(nums.size() == 0);
14 // expected-warning@-2 {{TRUE}}
16 // expected-warning@-4 {{UNKNOWN}}
20 void testException(std::exception e) {
21 // Notice that the argument is NOT passed by reference, so we can devirtualize.
22 const char *x = e.what();
23 clang_analyzer_eval(x == 0);
25 // expected-warning@-2 {{TRUE}}
27 // expected-warning@-4 {{UNKNOWN}}