blob: d07242c92ae252c91a83f3e97fbebbc14374cf7a [file] [log] [blame]
Artem Dergachev13b20262018-01-17 23:46:13 +00001// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection,unix.Malloc -analyzer-config c++-allocator-inlining=true -std=c++11 -verify %s
2
3void clang_analyzer_eval(bool);
4
5typedef __typeof__(sizeof(int)) size_t;
6
7void *malloc(size_t size);
8
9void *operator new(size_t size) throw() {
10 void *x = malloc(size);
11 if (!x)
12 return nullptr;
13 return x;
14}
15
16void checkNewAndConstructorInlining() {
17 int *s = new int;
18} // expected-warning {{Potential leak of memory pointed to by 's'}}