summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-02-01 11:14:57 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-02-05 11:06:37 +0000
commita300c3810cd1e91a3946447aaa3bce9e6b8b278f (patch)
treeb2eb13be93cc73b9baee73c4561093e81a21b046 /src/corelib/global
parente400ba64a39703a87bbdbd213504bd384997a5a2 (diff)
Detect clang-cl features as clang not as msvc
Clang-cl supports the clang detections, and only approximates specific MSVC version. This works as the MSVC standard library is ahead of the clang standard library. Where this logic was written 7 years ago when it was not the case. Pick-to: 6.3 Change-Id: Ic13e2f2fbcde011a0d8831cc48c0c9041bfe3b99 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qcompilerdetection.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index bfa4f89105..00b55c7ab4 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -626,7 +626,7 @@
# endif
#endif
-#if defined(Q_CC_CLANG) && !defined(Q_CC_INTEL) && !defined(Q_CC_MSVC)
+#if defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
/* General C++ features */
# define Q_COMPILER_RESTRICTED_VLA
# if __has_feature(attribute_deprecated_with_message)
@@ -785,14 +785,11 @@
# endif
# endif
-#endif // Q_CC_CLANG && !Q_CC_INTEL && !Q_CC_MSVC
-
-#if defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
# ifndef Q_DECL_UNUSED
# define Q_DECL_UNUSED __attribute__((__unused__))
# endif
# define Q_DECL_UNUSED_MEMBER Q_DECL_UNUSED
-#endif
+#endif // defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG)
# define Q_COMPILER_RESTRICTED_VLA
@@ -897,7 +894,7 @@
# endif
#endif
-#if defined(Q_CC_MSVC)
+#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
# if defined(__cplusplus)
/* C++11 features supported in VC8 = VC2005: */
# define Q_COMPILER_VARIADIC_MACROS
@@ -955,7 +952,7 @@
# define Q_COMPILER_CONSTEXPR
# endif
# endif /* __cplusplus */
-#endif /* Q_CC_MSVC */
+#endif // defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
#ifdef Q_COMPILER_UNICODE_STRINGS
# define Q_STDLIB_UNICODE_STRINGS