From ef68bd6bf4b208de16a39d146ef93ce13de1673d Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 31 Mar 2020 11:01:29 +0100 Subject: [PATCH] C++: Add a test of direct calls to operator new / operator dedelete. --- cpp/ql/test/library-tests/allocators/allocators.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpp/ql/test/library-tests/allocators/allocators.cpp b/cpp/ql/test/library-tests/allocators/allocators.cpp index 6571245f5fc..92241b9c9e3 100644 --- a/cpp/ql/test/library-tests/allocators/allocators.cpp +++ b/cpp/ql/test/library-tests/allocators/allocators.cpp @@ -143,3 +143,9 @@ void multidimensionalNew(int x, int y) { auto p2 = new char[20][20]; auto p3 = new char[x][30][30]; } + +void directOperatorCall() { + void *ptr; + ptr = operator new(sizeof(int)); + operator delete(ptr); +}