brintos

brintos / llvm-project-archived public Read only

0
0
Text · 541 B · 523785a Raw
24 lines · cpp
1// RUN: %clang_analyze_cc1 -analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks,unix.Malloc -std=c++11 -fblocks -verify %s2// expected-no-diagnostics3 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 warn17 18  void *p2 = operator new[](0, x); // no warn19 20  int *p3 = new (x) int; // no warn21 22  int *p4 = new (x) int[0]; // no warn23}24