diff options
Diffstat (limited to 'test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp')
| -rw-r--r-- | test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp | 13 | 
1 files changed, 12 insertions, 1 deletions
| diff --git a/test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp b/test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp index 639790d31a91..bca223b6e04a 100644 --- a/test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp +++ b/test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp @@ -24,5 +24,16 @@ void testNewDeleteNoWarn() {    int *p4 = new int;    delete p4; -  int j = *p4; // no-warning   +  int j = *p4; // no-warning +} + +void testUseZeroAllocNoWarn() { +  int *p1 = (int *)operator new(0); +  *p1 = 1; // no-warning + +  int *p2 = (int *)operator new[](0); +  p2[0] = 1; // no-warning + +  int *p3 = new int[0]; +  p3[0] = 1; // no-warning  } | 
