Placement new operators on non-object types cause crash in bugprone-misplaced-pointer-arithmetic-in-alloc. This patch fixes this issue.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Please fix the test case first, can't call operator new(unsigned long, void*) with an argument of type void*
The other failures the pre merge bot detected can safely be disregarded
Comment Actions
Placement new is defined per standard:
void* operator new ( std::size_t count, void* ptr );
Here, the problem is that size_t is unsigned long on Linux and it seems that it is unsigned long long on Windows. How should I overcome this?
Comment Actions
In CSA, to overcome the platform problem, it is common to add a target triple for the RUN line:
https://github.com/llvm/llvm-project/blob/master/clang/test/Analysis/std-c-library-functions.c#L14