diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h index 5ae33343949..69221877f15 100644 --- a/intern/guardedalloc/MEM_guardedalloc.h +++ b/intern/guardedalloc/MEM_guardedalloc.h @@ -281,6 +281,8 @@ inline T *MEM_new(const char *allocation_name, Args &&...args) */ template inline void MEM_delete(const T *ptr) { + static_assert(!std::is_void_v, + "MEM_delete on a void pointer not possible. Cast it to a non-void type?"); if (ptr == nullptr) { /* Support #ptr being null, because C++ `delete` supports that as well. */ return;