mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 02:43:04 +01:00
Check for incomplete type in AutoPtr destructor.
This commit is contained in:
parent
81fb1c7d6a
commit
52ce2830b8
@ -42,6 +42,7 @@ class SimpleDelete
|
|||||||
public:
|
public:
|
||||||
static void clear(What* ptr)
|
static void clear(What* ptr)
|
||||||
{
|
{
|
||||||
|
static_assert(sizeof(What) > 0, "can't delete pointer to incomplete type");
|
||||||
delete ptr;
|
delete ptr;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -61,6 +62,7 @@ class ArrayDelete
|
|||||||
public:
|
public:
|
||||||
static void clear(What* ptr)
|
static void clear(What* ptr)
|
||||||
{
|
{
|
||||||
|
static_assert(sizeof(What) > 0, "can't delete pointer to incomplete type");
|
||||||
delete[] ptr;
|
delete[] ptr;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user