8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 00:03:02 +01:00

Check for incomplete type in AutoPtr destructor.

This commit is contained in:
Adriano dos Santos Fernandes 2021-10-18 10:13:30 -03:00
parent 81fb1c7d6a
commit 52ce2830b8

View File

@ -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;
}
};