blob: 129af1f9c69701f2b0a42a23e9be053de164d165 [file] [log] [blame]
Anton Yartsev3d117082013-04-02 05:59:24 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.cplusplus.NewDelete,unix.Malloc -analyzer-store region -std=c++11 -fblocks -verify %s
Anton Yartsev69746282013-03-28 16:10:38 +00002// expected-no-diagnostics
3
4namespace std {
5 typedef __typeof__(sizeof(int)) size_t;
6}
7
8void *operator new(std::size_t, ...);
9void *operator new[](std::size_t, ...);
10
11void testGlobalCustomVariadicNew() {
12 void *p1 = operator new(0); // no warn
13
14 void *p2 = operator new[](0); // no warn
15
16 int *p3 = new int; // no warn
17
18 int *p4 = new int[0]; // no warn
19}