aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2024-02-28 09:21:15 +0100
committerEike Ziller <eike.ziller@qt.io>2024-03-05 08:09:18 +0000
commitdb5ac2dc15f0ac607c03416e538ae2ffc5482467 (patch)
treef0e88fc1bf1f67d620229e79c95a1fa0372de6a0 /src
parentc4e8963d8dd97a934b5253babc53a98e944a0606 (diff)
Utils: Fix build on macOS < 13 with C++20
The Clang implementation of span is incomplete until LLVM 15 / Xcode 15 / macOS 13.5 Change-Id: Iac8514fc84643cb4dae9cfaac603df5e798f9ff4 Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src')
-rw-r--r--src/libs/utils/span.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libs/utils/span.h b/src/libs/utils/span.h
index b1fba81447..d21bb9ab00 100644
--- a/src/libs/utils/span.h
+++ b/src/libs/utils/span.h
@@ -5,7 +5,9 @@
#include <qcompilerdetection.h>
-#if __cplusplus >= 202002L
+// The (Apple) Clang implementation of span is incomplete until LLVM 15 / Xcode 14.3 / macOS 13
+#if __cplusplus >= 202002L \
+ && !(defined(__apple_build_version__) && __apple_build_version__ < 14030022)
#include <span>
namespace Utils {
@@ -22,6 +24,11 @@ QT_WARNING_PUSH
#elif defined(Q_CC_GNU) || defined(Q_CC_CLANG)
#pragma GCC system_header
#endif
+
+// disable automatic usage of std::span in span-lite
+// since we make that decision ourselves at the top of this header
+#define span_CONFIG_SELECT_SPAN span_SPAN_NONSTD
+
#include <3rdparty/span/span.hpp>
namespace Utils {
using namespace nonstd;