summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.h
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-09-01 11:35:12 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-09-01 11:35:53 +0200
commit2dfc786c26663a2d555a8c8152c5ff95a3b0672e (patch)
treefbf4d41dc1836ffa607e70e2348102066a83855c /src/corelib/global/qglobal.h
parentd444bbf110e83c72d0657203896ad3c8a4cb5107 (diff)
parent1812bb968c49d50745ab2b10787320205c54f946 (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Diffstat (limited to 'src/corelib/global/qglobal.h')
-rw-r--r--src/corelib/global/qglobal.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 673369a012..9176d80f43 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -880,7 +880,12 @@ public:
int control;
};
-# ifdef Q_COMPILER_DECLTYPE
+// We need to use __typeof__ if we don't have decltype or if the compiler
+// hasn't been updated to the fix of Core Language Defect Report 382
+// (http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#382).
+// GCC 4.3 and 4.4 have support for decltype, but are affected by DR 382.
+# if defined(Q_COMPILER_DECLTYPE) && \
+ (defined(Q_CC_CLANG) || defined(Q_CC_INTEL) || !defined(Q_CC_GNU) || (__GNUC__ * 100 + __GNUC_MINOR__) >= 405)
# define QT_FOREACH_DECLTYPE(x) typename QtPrivate::remove_reference<decltype(x)>::type
# else
# define QT_FOREACH_DECLTYPE(x) __typeof__((x))