diff options
author | Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> | 2021-09-30 14:11:14 +0200 |
---|---|---|
committer | Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> | 2021-10-01 02:46:09 +0200 |
commit | 44a74127954dce2416842a6644cbdff4c513b6fb (patch) | |
tree | b97491cf7d9e566e6ff24e622feb5c86933ca594 /src | |
parent | 79f62380f09988949bc601060ff5131cf34de872 (diff) |
Remove checks for C++ standard versions C++17 and below
Qt requires a compiler that support C++17 thus __cplusplus
is always 201703L or higher. This patch removes checks
for __cplusplus value that always succeed.
Change-Id: I4b830683ecefab8f913d8b09604086d53209d2e3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/kernel/qproperty.h | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qvariant.h | 6 | ||||
-rw-r--r-- | src/corelib/text/qstring.h | 5 | ||||
-rw-r--r-- | src/corelib/text/qstringtokenizer.h | 4 | ||||
-rw-r--r-- | src/corelib/tools/qduplicatetracker_p.h | 2 |
5 files changed, 6 insertions, 13 deletions
diff --git a/src/corelib/kernel/qproperty.h b/src/corelib/kernel/qproperty.h index 356eb43cd3..4358182c25 100644 --- a/src/corelib/kernel/qproperty.h +++ b/src/corelib/kernel/qproperty.h @@ -56,7 +56,7 @@ #endif #endif -#if !defined(QT_PROPERTY_COLLECT_BINDING_LOCATION) && __has_include(<experimental/source_location>) && __cplusplus >= 201703L && !defined(Q_CLANG_QDOC) +#if !defined(QT_PROPERTY_COLLECT_BINDING_LOCATION) && __has_include(<experimental/source_location>) && !defined(Q_CLANG_QDOC) #include <experimental/source_location> #if defined(__cpp_lib_experimental_source_location) #define QT_SOURCE_LOCATION_NAMESPACE std::experimental diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index d8ef892cb7..213368a036 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -58,7 +58,7 @@ #include <memory> #include <type_traits> -#if __has_include(<variant>) && __cplusplus >= 201703L +#if __has_include(<variant>) #include <variant> #elif defined(Q_CLANG_QDOC) namespace std { template<typename...> struct variant; } @@ -402,7 +402,7 @@ class Q_CORE_EXPORT QVariant return QVariant(QMetaType::fromType<T>(), std::addressof(value)); } -#if (__has_include(<variant>) && __cplusplus >= 201703L) || defined(Q_CLANG_QDOC) +#if __has_include(<variant>) || defined(Q_CLANG_QDOC) template<typename... Types> static inline QVariant fromStdVariant(const std::variant<Types...> &value) { @@ -580,7 +580,7 @@ inline QVariant QVariant::fromValue(const QVariant &value) return value; } -#if __has_include(<variant>) && __cplusplus >= 201703L +#if __has_include(<variant>) template<> inline QVariant QVariant::fromValue(const std::monostate &) { diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index b2231a239b..b6060530fb 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -1466,12 +1466,7 @@ inline std::wstring QString::toStdWString() const { std::wstring str; str.resize(length()); -#if __cplusplus >= 201703L str.resize(toWCharArray(str.data())); -#else - if (length()) - str.resize(toWCharArray(&str.front())); -#endif return str; } diff --git a/src/corelib/text/qstringtokenizer.h b/src/corelib/text/qstringtokenizer.h index 796ba1d810..d14099ffbb 100644 --- a/src/corelib/text/qstringtokenizer.h +++ b/src/corelib/text/qstringtokenizer.h @@ -46,9 +46,7 @@ QT_BEGIN_NAMESPACE template <typename, typename> class QStringBuilder; -#if defined(Q_QDOC) || 1 || (defined(__cpp_range_based_for) && __cpp_range_based_for >= 201603) -# define Q_STRINGTOKENIZER_USE_SENTINEL -#endif +#define Q_STRINGTOKENIZER_USE_SENTINEL class QStringTokenizerBaseBase { diff --git a/src/corelib/tools/qduplicatetracker_p.h b/src/corelib/tools/qduplicatetracker_p.h index 8d64ee5371..19f69161a6 100644 --- a/src/corelib/tools/qduplicatetracker_p.h +++ b/src/corelib/tools/qduplicatetracker_p.h @@ -52,7 +52,7 @@ #include <qglobal.h> -#if __has_include(<memory_resource>) && __cplusplus > 201402L +#if __has_include(<memory_resource>) # include <unordered_set> # include <memory_resource> # include <qhash.h> // for the hashing helpers |