summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-12-16 09:38:46 +0100
committerLiang Qi <liang.qi@qt.io>2016-12-16 09:45:16 +0100
commit9bfe3ab71e5291445e66be96d6cd1f63934a2d83 (patch)
treea3b5580d8788de658f39d5bdb23d84a447999bee /src/corelib
parent28dffdecdad4f3458b9aacec1a04803c7b5483a1 (diff)
parent179045f36a16ce2f6cfaad1dbd9443b52b1bf8d3 (diff)
Merge remote-tracking branch 'origin/5.8.0' into 5.8
Conflicts: doc/global/qt-cpp-defines.qdocconf src/plugins/platforms/android/qandroidplatformopenglcontext.h src/plugins/platforms/android/qandroidplatformtheme.h Change-Id: I13d51cc66f708138ff4d667ceea7d515992e58a4
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qcompilerdetection.h4
-rw-r--r--src/corelib/global/qglobal.h6
-rw-r--r--src/corelib/global/qlogging.cpp4
-rw-r--r--src/corelib/global/qnumeric_p.h12
-rw-r--r--src/corelib/io/qdebug.cpp16
-rw-r--r--src/corelib/kernel/qdeadlinetimer.cpp6
-rw-r--r--src/corelib/kernel/qmetatype.h5
-rw-r--r--src/corelib/thread/qmutex.cpp4
-rw-r--r--src/corelib/tools/qalgorithms.h4
9 files changed, 40 insertions, 21 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index d978c141a4..4142c17b42 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -1273,7 +1273,7 @@
# define QT_WARNING_DISABLE_INTEL(number) __pragma(warning(disable: number))
# define QT_WARNING_DISABLE_CLANG(text)
# define QT_WARNING_DISABLE_GCC(text)
-# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_INTEL(1786)
+# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_INTEL(1478 1786)
#elif defined(Q_CC_INTEL)
/* icc: Intel compiler on Linux or OS X */
# define QT_WARNING_PUSH QT_DO_PRAGMA(warning(push))
@@ -1282,7 +1282,7 @@
# define QT_WARNING_DISABLE_MSVC(number)
# define QT_WARNING_DISABLE_CLANG(text)
# define QT_WARNING_DISABLE_GCC(text)
-# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_INTEL(1786)
+# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_INTEL(1478 1786)
#elif defined(Q_CC_MSVC) && _MSC_VER >= 1500 && !defined(Q_CC_CLANG)
# undef QT_DO_PRAGMA /* not needed */
# define QT_WARNING_PUSH __pragma(warning(push))
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 1737f58c87..32176913ea 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -921,10 +921,10 @@ template <typename T>
class QForeachContainer {
QForeachContainer &operator=(const QForeachContainer &) Q_DECL_EQ_DELETE;
public:
- QForeachContainer(const T &t) : c(t) {}
- QForeachContainer(T &&t) : c(std::move(t)) {}
+ QForeachContainer(const T &t) : c(t), i(c.begin()), e(c.end()) {}
+ QForeachContainer(T &&t) : c(std::move(t)), i(c.begin()), e(c.end()) {}
const T c;
- typename T::const_iterator i = c.begin(), e = c.end();
+ typename T::const_iterator i, e;
int control = 1;
};
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 0506d372b6..6b90a47388 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -1042,6 +1042,10 @@ void QMessagePattern::setPattern(const QString &pattern)
delete [] literals;
}
delete [] tokens;
+ timeArgs.clear();
+#ifdef QLOGGING_HAVE_BACKTRACE
+ backtraceArgs.clear();
+#endif
// scanner
QList<QString> lexemes;
diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h
index 23fcf340f1..01b8772ee1 100644
--- a/src/corelib/global/qnumeric_p.h
+++ b/src/corelib/global/qnumeric_p.h
@@ -68,7 +68,8 @@
#if !defined(Q_CC_MSVC) && (defined(Q_OS_QNX) || defined(Q_CC_INTEL) || !defined(__cplusplus))
# include <math.h>
-# define QT_MATH_H_DEFINES_MACROS
+# ifdef isnan
+# define QT_MATH_H_DEFINES_MACROS
QT_BEGIN_NAMESPACE
namespace qnumeric_std_wrapper {
// the 'using namespace std' below is cases where the stdlib already put the math.h functions in the std namespace and undefined the macros.
@@ -81,10 +82,11 @@ static inline bool math_h_isfinite(float f) { using namespace std; return isfini
}
QT_END_NAMESPACE
// These macros from math.h conflict with the real functions in the std namespace.
-#undef signbit
-#undef isnan
-#undef isinf
-#undef isfinite
+# undef signbit
+# undef isnan
+# undef isinf
+# undef isfinite
+# endif // defined(isnan)
#endif
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp
index fa919e9f10..be33ec2d23 100644
--- a/src/corelib/io/qdebug.cpp
+++ b/src/corelib/io/qdebug.cpp
@@ -579,6 +579,22 @@ QDebug &QDebug::resetFormat()
*/
/*!
+ \fn QDebug &QDebug::operator<<(char16_t t)
+ \since 5.5
+
+ Writes the UTF-16 character, \a t, to the stream and returns a reference
+ to the stream.
+*/
+
+/*!
+ \fn QDebug &QDebug::operator<<(char32_t t)
+ \since 5.5
+
+ Writes the UTF-32 character, \a t, to the stream and returns a reference
+ to the stream.
+*/
+
+/*!
\fn QDebug &QDebug::operator<<(const QString &s)
Writes the string, \a s, to the stream and returns a reference to the
diff --git a/src/corelib/kernel/qdeadlinetimer.cpp b/src/corelib/kernel/qdeadlinetimer.cpp
index d670637d53..1f554c9f2e 100644
--- a/src/corelib/kernel/qdeadlinetimer.cpp
+++ b/src/corelib/kernel/qdeadlinetimer.cpp
@@ -122,6 +122,7 @@ Q_DECL_CONST_FUNCTION static inline QPair<qint64, qint64> toSecsAndNSecs(qint64
\code
using namespace std::chrono;
+ using namespace std::chrono_literals;
QDeadlineTimer deadline(30s);
device->waitForReadyRead(deadline);
@@ -141,6 +142,7 @@ Q_DECL_CONST_FUNCTION static inline QPair<qint64, qint64> toSecsAndNSecs(qint64
\code
using namespace std::chrono;
+ using namespace std::chrono_literals;
auto now = steady_clock::now();
QDeadlineTimer deadline(now + 1s);
Q_ASSERT(deadline == now + 1s);
@@ -240,7 +242,7 @@ QDeadlineTimer::QDeadlineTimer(qint64 msecs, Qt::TimerType type) Q_DECL_NOTHROW
This constructor can be used with C++14's user-defined literals for time, such as in:
\code
- using namespace std::chrono;
+ using namespace std::chrono_literals;
QDeadlineTimer deadline(250ms);
\endcode
@@ -333,7 +335,7 @@ void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, qint64 nsecs, Qt::Time
This function can be used with C++14's user-defined literals for time, such as in:
\code
- using namespace std::chrono;
+ using namespace std::chrono_literals;
deadline.setRemainingTime(250ms);
\endcode
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index e64812b3ae..7b0a9f986b 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -1389,10 +1389,6 @@ namespace QtPrivate
};
-QT_WARNING_PUSH
-// In C++03 mode, clang consider local or unnamed type and throw a warning instead of ignoring them
-QT_WARNING_DISABLE_CLANG("-Wunnamed-type-template-args")
-QT_WARNING_DISABLE_CLANG("-Wlocal-type-template-args")
template<typename T> char qt_getEnumMetaObject(const T&);
template<typename T>
@@ -1405,7 +1401,6 @@ QT_WARNING_DISABLE_CLANG("-Wlocal-type-template-args")
enum { Value = sizeof(qt_getEnumMetaObject(declval())) == sizeof(QMetaObject*) };
};
template<> struct IsQEnumHelper<void> { enum { Value = false }; };
-QT_WARNING_POP
template<typename T, typename Enable = void>
struct MetaObjectForType
diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp
index 0aee4aeda4..653c3efe1c 100644
--- a/src/corelib/thread/qmutex.cpp
+++ b/src/corelib/thread/qmutex.cpp
@@ -279,7 +279,7 @@ bool QMutex::tryLock(int timeout) QT_MUTEX_LOCK_NOEXCEPT
for the mutex to become available.
Note: Passing a negative duration as the \a duration is equivalent to
- calling try_lock(). This behavior is different from tryLock.
+ calling try_lock(). This behavior differs from tryLock().
If the lock was obtained, the mutex must be unlocked with unlock()
before another thread can successfully lock it.
@@ -303,7 +303,7 @@ bool QMutex::tryLock(int timeout) QT_MUTEX_LOCK_NOEXCEPT
for the mutex to become available.
Note: Passing a \a timePoint which has already passed is equivalent
- to calling try_lock. This behavior is different from tryLock.
+ to calling try_lock(). This behavior differs from tryLock().
If the lock was obtained, the mutex must be unlocked with unlock()
before another thread can successfully lock it.
diff --git a/src/corelib/tools/qalgorithms.h b/src/corelib/tools/qalgorithms.h
index 7e846956f5..fb7031ce71 100644
--- a/src/corelib/tools/qalgorithms.h
+++ b/src/corelib/tools/qalgorithms.h
@@ -535,7 +535,7 @@ QT_DEPRECATED_X("Use std::binary_search") Q_OUTOFLINE_TEMPLATE RandomAccessItera
# define QT_HAS_BUILTIN_CTZS
Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) Q_DECL_NOTHROW
{
-# if QT_HAS_BUILTIN(__builtin_ctzs) || defined(__BMI__)
+# if QT_HAS_BUILTIN(__builtin_ctzs)
return __builtin_ctzs(v);
# else
return __builtin_ctz(v);
@@ -544,7 +544,7 @@ Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) Q_DECL_NOTHROW
#define QT_HAS_BUILTIN_CLZS
Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) Q_DECL_NOTHROW
{
-# if QT_HAS_BUILTIN(__builtin_clzs) || defined(__BMI__)
+# if QT_HAS_BUILTIN(__builtin_clzs)
return __builtin_clzs(v);
# else
return __builtin_clz(v) - 16U;