aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorFredrik Orderud <fredrik.orderud@ge.com>2018-10-30 10:40:56 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2018-11-02 06:52:03 +0000
commitacd0882f818bf05677e3e117dbd4975674d9578b (patch)
treea9074cb569f91ab49f355e8353926889eb63092f /src/qml/qml
parent8b418d9be73dafd25c9c528127274a3573f1a7e1 (diff)
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>
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/qqmlprivate.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlprivate.h b/src/qml/qml/qqmlprivate.h
index 22e46fd7ed..c0232a7691 100644
--- a/src/qml/qml/qqmlprivate.h
+++ b/src/qml/qml/qqmlprivate.h
@@ -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>