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:
parent
81fb1c7d6a
commit
52ce2830b8
@ -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;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user