Extend QQmlElement with empty placement delete operator
The signature is based on [1] and [2], with an empty implementation to match the default behavior. This mutes the following warning when building with MSVC 2015 & 2017: warning: C4291: 'void *operator new(::size_t,void *) throw()': no matching operator delete found; memory will not be freed if initialization throws an exception [1] https://en.cppreference.com/w/cpp/memory/new/operator_delete (#13) [2] http://www.cplusplus.com/reference/new/operator%20delete/ (#3) Task-number: QTBUG-71024 Change-Id: I32f80a902672d9af27960a185a1b0c91798806c5 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
parent
8b418d9be7
commit
acd0882f81
|
@ -109,6 +109,10 @@ namespace QQmlPrivate
|
|||
// the size that was allocated.
|
||||
::operator delete (ptr);
|
||||
}
|
||||
static void operator delete(void *, void *) {
|
||||
// Deliberately empty placement delete operator.
|
||||
// Silences MSVC warning C4291: no matching operator delete found
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
|
Loading…
Reference in New Issue