aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/ErrorTest.cpp
diff options
context:
space:
mode:
authorMoritz Sichert <sichert@in.tum.de>2021-05-26 10:50:15 +0200
committerMoritz Sichert <sichert@in.tum.de>2021-07-08 11:59:22 +0200
commitd58c7a92380e030af6e6f82ce55bc14a919f39ea (patch)
treea2913957604b324b99b54f11e80f608f9c41d69c /llvm/unittests/Support/ErrorTest.cpp
parent715ca752ac4f8ba69fe68110823e0eabf5614bc7 (diff)
downloadllvm-d58c7a92380e030af6e6f82ce55bc14a919f39ea.zip
llvm-d58c7a92380e030af6e6f82ce55bc14a919f39ea.tar.gz
llvm-d58c7a92380e030af6e6f82ce55bc14a919f39ea.tar.bz2
[IR] Added operator delete to subclasses of User to avoid UB
Several subclasses of User override operator new without also overriding operator delete. This means that delete expressions fall back to using operator delete of the base class, which would be User. However, this is only allowed if the base class has a virtual destructor which is not the case for User, so this is UB. See also [expr.delete] (3) for the exact wording. This is actually detected in some cases by GCC 11's -Wmismatched-new-delete now which is how I found this error. Differential Revision: https://reviews.llvm.org/D103143
Diffstat (limited to 'llvm/unittests/Support/ErrorTest.cpp')
0 files changed, 0 insertions, 0 deletions