Jordan Rose | e449edc | 2013-04-05 17:55:07 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -analyze -analyzer-checker=core,cplusplus.NewDelete,alpha.cplusplus.NewDeleteLeaks,unix.Malloc -std=c++11 -fblocks -verify %s |
Anton Yartsev | 6974628 | 2013-03-28 16:10:38 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
| 3 | |
| 4 | namespace std { |
| 5 | typedef __typeof__(sizeof(int)) size_t; |
| 6 | } |
| 7 | |
| 8 | void *operator new(std::size_t, ...); |
| 9 | void *operator new[](std::size_t, ...); |
| 10 | |
| 11 | void 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 | } |