From e02933a17c3615bc6e86f571fc6946390f43bd16 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 4 Dec 2022 11:41:25 -0800 Subject: [PATCH] QAnyStringView: move the two assertions to a central place Move the assertions to qtypes.cpp, next to where one of them already existed. Change-Id: I51d12ccdc56c4ad2af07fffd172dae7c49d78273 Reviewed-by: Marc Mutz --- src/corelib/global/qtypes.cpp | 1 + src/corelib/text/qanystringview.h | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/global/qtypes.cpp b/src/corelib/global/qtypes.cpp index 515f158f52..5c3b963a92 100644 --- a/src/corelib/global/qtypes.cpp +++ b/src/corelib/global/qtypes.cpp @@ -392,6 +392,7 @@ static_assert(std::numeric_limits::radix == 2, static_assert(sizeof(size_t) == sizeof(void *), "size_t and a pointer don't have the same size"); static_assert(sizeof(size_t) == sizeof(qsizetype)); // implied by the definition static_assert((std::is_same::value)); +static_assert(std::is_same_v); // Check that our own typedefs are not broken. static_assert(sizeof(qint8) == 1, "Internal error, qint8 is misdefined"); diff --git a/src/corelib/text/qanystringview.h b/src/corelib/text/qanystringview.h index 7f8b1d6155..f8660b4d2b 100644 --- a/src/corelib/text/qanystringview.h +++ b/src/corelib/text/qanystringview.h @@ -33,8 +33,6 @@ public: typedef qptrdiff difference_type; typedef qsizetype size_type; private: - static_assert(std::is_same_v); - static_assert(sizeof(size_t) == sizeof(qsizetype)); static constexpr size_t SizeMask = (std::numeric_limits::max)() / 4; #if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0) || defined(QT_BOOTSTRAPPED) static constexpr int SizeShift = 2;