summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-08-02 22:49:38 +0200
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-08-02 22:52:32 +0200
commitee07b912a1768ea0b103544f9eeac41f3cf50cf6 (patch)
tree15bfa7e4a9c098511c1fc89e2b2c240520b85e2d /src/corelib/tools
parent4bfff6a98b59b32605d881a463ad3edc221a7dc8 (diff)
parenta96656a8fb6a3c1fc7765659efff28f807fd0deb (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/widgets/qdockarealayout.cpp src/widgets/widgets/qmainwindow.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmainwindowlayout_p.h tests/auto/corelib/tools/qlocale/tst_qlocale.cpp tests/auto/other/macnativeevents/BLACKLIST tests/auto/widgets/widgets/qmenu/BLACKLIST Change-Id: Ic8e724b80a65e7b1af25511b0e674d209265e567
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qhash.h16
-rw-r--r--src/corelib/tools/qlocale.cpp2
2 files changed, 16 insertions, 2 deletions
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index 0b0f935b26..715acc77ce 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -959,8 +959,22 @@ Q_OUTOFLINE_TEMPLATE bool QHash<Key, T>::operator==(const QHash &other) const
return false;
// Keys in the ranges are equal by construction; this checks only the values.
- if (!std::is_permutation(it, thisEqualRangeEnd, otherEqualRange.first))
+ //
+ // When using the 3-arg std::is_permutation, MSVC will emit warning C4996,
+ // passing an unchecked iterator to a Standard Library algorithm. We don't
+ // want to suppress the warning, and we can't use stdext::make_checked_array_iterator
+ // because QHash::(const_)iterator does not work with size_t and thus will
+ // emit more warnings. Use the 4-arg std::is_permutation instead (which
+ // is supported since MSVC 2015).
+ //
+ // ### Qt 6: if C++14 library support is a mandated minimum, remove the ifdef for MSVC.
+ if (!std::is_permutation(it, thisEqualRangeEnd, otherEqualRange.first
+#if defined(Q_CC_MSVC) && _MSC_VER >= 1900
+ , otherEqualRange.second
+#endif
+ )) {
return false;
+ }
it = thisEqualRangeEnd;
}
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 789a15dded..5db181885c 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -320,7 +320,7 @@ QByteArray QLocalePrivate::bcp47Name(char separator) const
if (m_data->m_language_id == QLocale::AnyLanguage)
return QByteArray();
if (m_data->m_language_id == QLocale::C)
- return QByteArrayLiteral("C");
+ return QByteArrayLiteral("en");
QLocaleId localeId = QLocaleId::fromIds(m_data->m_language_id, m_data->m_script_id, m_data->m_country_id);
return localeId.withLikelySubtagsRemoved().name(separator);