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>
bb10
Thiago Macieira 2016-04-12 13:35:30 -07:00
parent f494da8895
commit 5b37c9f7d3
1 changed files with 4 additions and 0 deletions

View File

@ -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
{