1*184c6242SDominic Chen // RUN: %clang_analyze_cc1 -analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks,unix.Malloc -std=c++11 -fblocks -verify %s
28b662704SAnton Yartsev // expected-no-diagnostics
38b662704SAnton Yartsev 
48b662704SAnton Yartsev namespace std {
58b662704SAnton Yartsev   typedef __typeof__(sizeof(int)) size_t;
68b662704SAnton Yartsev }
78b662704SAnton Yartsev 
8bdd14643SRichard Smith struct X {};
9bdd14643SRichard Smith 
10bdd14643SRichard Smith void *operator new(std::size_t, X, ...);
11bdd14643SRichard Smith void *operator new[](std::size_t, X, ...);
128b662704SAnton Yartsev 
testGlobalCustomVariadicNew()138b662704SAnton Yartsev void testGlobalCustomVariadicNew() {
14bdd14643SRichard Smith   X x;
158b662704SAnton Yartsev 
16bdd14643SRichard Smith   void *p1 = operator new(0, x); // no warn
178b662704SAnton Yartsev 
18bdd14643SRichard Smith   void *p2 = operator new[](0, x); // no warn
198b662704SAnton Yartsev 
20bdd14643SRichard Smith   int *p3 = new (x) int; // no warn
21bdd14643SRichard Smith 
22bdd14643SRichard Smith   int *p4 = new (x) int[0]; // no warn
238b662704SAnton Yartsev }
24