CodeQL library for C/C++

Member predicate NewOrNewArrayExpr::getAllocatorCall

Gets the call to a non-default operator new that allocates storage, if any.

As a rule of thumb, there will be an allocator call precisely when the type being allocated has a custom operator new, or when an argument list appears after the new keyword and before the name of the type being allocated.

In particular note that uses of placement-new and nothrow-new will have an allocator call.

FunctionCall getAllocatorCall()