summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-01-26 17:39:06 +0100
committerMarc Mutz <marc.mutz@kdab.com>2017-02-23 05:44:58 +0000
commit2cda991ab19cbe115dfa965acc3686f067960773 (patch)
tree6433e8c4df3ccae6ad44ad15da123b8b12471199 /src/corelib
parentb952bd3605315465b1ceb90e0924707f781a9f9e (diff)
QStaticByteArrayMatcher: fix MSVC warning
MSVC 2013 complained: src/corelib/tools/qbytearraymatcher.h(143) : warning C4351: new behavior: elements of array 'QStaticByteArrayMatcher<6>::m_pattern' will be default initialized Fix the same way as 9a07ab9234ccb4ed0d6aa3a64b4b2c888635dae5: by suppressing the warning. Change-Id: Ic41f7eabe7e39709d76e6062f5891cdcfaa6e1ed Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qbytearraymatcher.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/tools/qbytearraymatcher.h b/src/corelib/tools/qbytearraymatcher.h
index 51e08ba4bf..476bc3c049 100644
--- a/src/corelib/tools/qbytearraymatcher.h
+++ b/src/corelib/tools/qbytearraymatcher.h
@@ -132,6 +132,9 @@ private:
}
};
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_MSVC(4351) // MSVC 2013: "new behavior: elements of array ... will be default initialized"
+ // remove once we drop MSVC 2013 support
template <uint N>
class QStaticByteArrayMatcher : QStaticByteArrayMatcherBase
{
@@ -153,6 +156,8 @@ public:
QByteArray pattern() const { return QByteArray(m_pattern, int(N - 1)); }
};
+QT_WARNING_POP
+
template <uint N>
Q_DECL_RELAXED_CONSTEXPR QStaticByteArrayMatcher<N> qMakeStaticByteArrayMatcher(const char (&pattern)[N]) Q_DECL_NOTHROW
{ return QStaticByteArrayMatcher<N>(pattern); }