PR49465: Disallow constant evaluation of a call to operator delete(nullptr).
authorRichard Smith <richard@metafoo.co.uk>
Tue, 9 Mar 2021 23:04:51 +0000 (15:04 -0800)
committerRichard Smith <richard@metafoo.co.uk>
Tue, 9 Mar 2021 23:06:06 +0000 (15:06 -0800)
commita892b0015ed6af5945d06e87ca5da1ad8be7ad29
tree07844cf898beacd4538e8998602d684a44494384
parent234f3211a3dd84bb2c074402054452af24b914a6
PR49465: Disallow constant evaluation of a call to operator delete(nullptr).

The only time we would consider allowing this is inside a call to
std::allocator<T>::deallocate, whose contract does not permit deletion
of null pointers.
clang/include/clang/Basic/DiagnosticASTKinds.td
clang/lib/AST/ExprConstant.cpp
clang/test/SemaCXX/cxx2a-constexpr-dynalloc.cpp