summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qmap.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-04-12 13:35:30 -0700
committerThiago Macieira <thiago.macieira@intel.com>2016-04-13 22:08:18 +0000
commit5b37c9f7d3153a756af8fa89b2467c87a3021a8b (patch)
tree2872e0c2e38785f56defc3712ccf66030658bc1c /src/corelib/tools/qmap.h
parentf494da8895fa7a28dbc9ff0a66235632c8c33167 (diff)
Work around Clang false-positive warning on returning default parameters
Clang 3.8 and Apple Clang 7.x seem to think that the parameter is a temporary. See https://llvm.org/bugs/show_bug.cgi?id=26396 Task-number: QTBUG-52134 Change-Id: Id75834dab9ed466e94c7ffff1444b6f2424d7fb7 Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
Diffstat (limited to 'src/corelib/tools/qmap.h')
-rw-r--r--src/corelib/tools/qmap.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index fe9ddaaa32..ed49e70f4e 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -634,6 +634,8 @@ Q_INLINE_TEMPLATE void QMap<Key, T>::clear()
*this = QMap<Key, T>();
}
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_CLANG("-Wreturn-stack-address")
template <class Key, class T>
Q_INLINE_TEMPLATE const T QMap<Key, T>::value(const Key &akey, const T &adefaultValue) const
@@ -642,6 +644,8 @@ Q_INLINE_TEMPLATE const T QMap<Key, T>::value(const Key &akey, const T &adefault
return n ? n->value : adefaultValue;
}
+QT_WARNING_POP
+
template <class Key, class T>
Q_INLINE_TEMPLATE const T QMap<Key, T>::operator[](const Key &akey) const
{