Files
clang-p2996/clang/test/Analysis/DeleteWithNonVirtualDtor.cpp
Viktor Cseh 0e246bb675 [clang][analyzer] Add C++ array delete checker
This checker reports cases where an array of polymorphic objects are
deleted as their base class. Deleting an array where the array's static
type is different from its dynamic type is undefined.

Since the checker is similar to DeleteWithNonVirtualDtorChecker, I
refactored that checker to support more detection types.

This checker corresponds to the SEI Cert rule EXP51-CPP: Do not delete
an array through a pointer of the incorrect type.

Differential Revision: https://reviews.llvm.org/D158156
2023-10-10 09:37:02 +01:00

6.5 KiB