NewDelete-variadic.cpp revision 651f13cea278ec967336033dd032faef0e9fc2ec
1// RUN: %clang_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete,alpha.cplusplus.NewDeleteLeaks,unix.Malloc -std=c++11 -fblocks -verify %s
2// expected-no-diagnostics
3
4namespace std {
5  typedef __typeof__(sizeof(int)) size_t;
6}
7
8struct X {};
9
10void *operator new(std::size_t, X, ...);
11void *operator new[](std::size_t, X, ...);
12
13void testGlobalCustomVariadicNew() {
14  X x;
15
16  void *p1 = operator new(0, x); // no warn
17
18  void *p2 = operator new[](0, x); // no warn
19
20  int *p3 = new (x) int; // no warn
21
22  int *p4 = new (x) int[0]; // no warn
23}
24