summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qcompilerdetection.h
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2016-07-28 13:20:41 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2016-08-01 18:20:00 +0200
commitf6fc34294f5691da8aa7ab8dc0452c6fa9036b67 (patch)
tree3b8fe9841f88aa81e2f8f2d57cbbca2c4736ca6f /src/corelib/global/qcompilerdetection.h
parent6f75096afc000991111bb0fd7a7e530ce3518627 (diff)
parent0eb77c3011ee4d6bbc46dd2d40c9324e9bfcbecf (diff)
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts: configure 5.7 now supports clang on android; but dev re-worked configure src/gui/kernel/qevent.h One side renamed a parameter of a constructor; the other added an alternate constructor on the next line. Applied the rename to both for consistency. tests/auto/tools/moc/tst_moc.cpp Each side added a new test at the end. .qmake.conf Ignored 5.7's change to MODULE_VERSION. configure.json No conflict noticed by git; but changes in 5.7 were needed for the re-worked configure to accommodate 5.7's stricter handling of C++11. Change-Id: I9cda53836a32d7bf83828212c7ea00b1de3e09d2
Diffstat (limited to 'src/corelib/global/qcompilerdetection.h')
-rw-r--r--src/corelib/global/qcompilerdetection.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index c5424be035..70c9e97c13 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -557,6 +557,12 @@
* Q_COMPILER_RESTRICTED_VLA variable-length arrays, prior to __cpp_runtime_arrays
*/
+#ifdef __cplusplus
+# if __cplusplus < 201103L && !(defined(Q_CC_MSVC) && Q_CC_MSVC >= 1800)
+# error Qt requires a C++11 compiler and yours does not seem to be that.
+# endif
+#endif
+
#ifdef Q_CC_INTEL
# define Q_COMPILER_RESTRICTED_VLA
# define Q_COMPILER_VARIADIC_MACROS // C++11 feature supported as an extension in other modes, too
@@ -1023,6 +1029,33 @@
// critical definitions. (Reported as Intel Issue ID 6000117277)
# define __USE_CONSTEXPR 1
# define __USE_NOEXCEPT 1
+# elif defined(Q_CC_MSVC) && (defined(Q_CC_CLANG) || defined(Q_CC_INTEL))
+// Clang and the Intel compiler support more C++ features than the Microsoft compiler
+// so make sure we don't enable them if the MS headers aren't properly adapted.
+# ifndef _HAS_CONSTEXPR
+# undef Q_COMPILER_CONSTEXPR
+# endif
+# ifndef _HAS_DECLTYPE
+# undef Q_COMPILER_DECLTYPE
+# endif
+# ifndef _HAS_INITIALIZER_LISTS
+# undef Q_COMPILER_INITIALIZER_LISTS
+# endif
+# ifndef _HAS_NULLPTR_T
+# undef Q_COMPILER_NULLPTR
+# endif
+# ifndef _HAS_RVALUE_REFERENCES
+# undef Q_COMPILER_RVALUE_REFS
+# endif
+# ifndef _HAS_SCOPED_ENUM
+# undef Q_COMPILER_CLASS_ENUM
+# endif
+# ifndef _HAS_TEMPLATE_ALIAS
+# undef Q_COMPILER_TEMPLATE_ALIAS
+# endif
+# ifndef _HAS_VARIADIC_TEMPLATES
+# undef Q_COMPILER_VARIADIC_TEMPLATES
+# endif
# elif defined(_LIBCPP_VERSION)
// libc++ uses __has_feature(cxx_atomic), so disable the feature if the compiler
// doesn't support it. That's required for the Intel compiler 14.x or earlier on OS X, for example.