diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 57e80ae125..da15d401e3 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -310,6 +310,7 @@ private: // will be default-initialized # pragma warning ( push ) # pragma warning ( disable : 4345 ) +# pragma warning(disable : 4127) // conditional expression is constant #endif template @@ -324,10 +325,6 @@ void QVector::defaultConstruct(T *from, T *to) } } -#ifdef Q_CC_MSVC -# pragma warning ( pop ) -#endif - template void QVector::copyConstruct(const T *srcFrom, const T *srcTo, T *dstFrom) { @@ -339,11 +336,6 @@ void QVector::copyConstruct(const T *srcFrom, const T *srcTo, T *dstFrom) } } -#if defined(Q_CC_MSVC) -#pragma warning( push ) -#pragma warning( disable : 4127 ) // conditional expression is constant -#endif - template void QVector::destruct(T *from, T *to) { @@ -354,10 +346,6 @@ void QVector::destruct(T *from, T *to) } } -#if defined(Q_CC_MSVC) -#pragma warning( pop ) -#endif - template inline QVector::QVector(const QVector &v) { @@ -379,6 +367,10 @@ inline QVector::QVector(const QVector &v) } } +#if defined(Q_CC_MSVC) +#pragma warning( pop ) +#endif + template void QVector::detach() { @@ -506,6 +498,11 @@ QVector::QVector(int asize, const T &t) } #ifdef Q_COMPILER_INITIALIZER_LISTS +# if defined(Q_CC_MSVC) +QT_WARNING_PUSH +QT_WARNING_DISABLE_MSVC(4127) // conditional expression is constant +# endif // Q_CC_MSVC + template QVector::QVector(std::initializer_list args) { @@ -520,7 +517,10 @@ QVector::QVector(std::initializer_list args) d = Data::sharedNull(); } } -#endif +# if defined(Q_CC_MSVC) +QT_WARNING_POP +# endif // Q_CC_MSVC +#endif // Q_COMPILER_INITALIZER_LISTS template void QVector::freeData(Data *x) @@ -529,6 +529,11 @@ void QVector::freeData(Data *x) Data::deallocate(x); } +#if defined(Q_CC_MSVC) +QT_WARNING_PUSH +QT_WARNING_DISABLE_MSVC(4127) // conditional expression is constant +#endif + template void QVector::reallocData(const int asize, const int aalloc, QArrayData::AllocationOptions options) { @@ -620,6 +625,10 @@ void QVector::reallocData(const int asize, const int aalloc, QArrayData::Allo Q_ASSERT(d->size == asize); } +#if defined(Q_CC_MSVC) +QT_WARNING_POP +#endif + template Q_OUTOFLINE_TEMPLATE T QVector::value(int i) const {