diff --git a/src/common/classes/auto.h b/src/common/classes/auto.h index 95451e2e46..5c7b3f59da 100644 --- a/src/common/classes/auto.h +++ b/src/common/classes/auto.h @@ -42,6 +42,7 @@ class SimpleDelete public: static void clear(What* ptr) { + static_assert(sizeof(What) > 0, "can't delete pointer to incomplete type"); delete ptr; } }; @@ -61,6 +62,7 @@ class ArrayDelete public: static void clear(What* ptr) { + static_assert(sizeof(What) > 0, "can't delete pointer to incomplete type"); delete[] ptr; } };