diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-08-12 14:14:02 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-08-14 15:52:58 +0200 |
commit | 6f0df02d002356625f10683ef84da7685d92a2c4 (patch) | |
tree | 46713209af459ebda534c3404f48c5f5c80ba3f8 /tests/auto/corelib/text | |
parent | 44cce1a2ea9dadd8b2de93f40de34269dda703c0 (diff) |
Replace Qt CONSTEXPR defines with constexpr
Both normal and relaxed constexpr are required by our new minimum of
C++17.
Change-Id: Ic028b88a2e7a6cb7d5925f3133b9d54859a81744
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'tests/auto/corelib/text')
4 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp b/tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp index 647a3ae379..654752f028 100644 --- a/tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp +++ b/tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp @@ -140,7 +140,7 @@ void tst_QByteArrayMatcher::indexIn() void tst_QByteArrayMatcher::staticByteArrayMatcher() { { - static Q_RELAXED_CONSTEXPR auto smatcher = qMakeStaticByteArrayMatcher("Hello"); + static constexpr auto smatcher = qMakeStaticByteArrayMatcher("Hello"); QCOMPARE(smatcher.pattern(), QByteArrayLiteral("Hello")); QCOMPARE(smatcher.indexIn(QByteArray("Hello, World!")), 0); @@ -186,7 +186,7 @@ void tst_QByteArrayMatcher::staticByteArrayMatcher() } { - static Q_RELAXED_CONSTEXPR auto smatcher = qMakeStaticByteArrayMatcher(LONG_STRING_256); + static constexpr auto smatcher = qMakeStaticByteArrayMatcher(LONG_STRING_256); QCOMPARE(smatcher.pattern(), QByteArrayLiteral(LONG_STRING_256)); QCOMPARE(smatcher.indexIn(QByteArray("a" LONG_STRING_256)), 1); diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp index 321e9ba32e..b26381c387 100644 --- a/tests/auto/corelib/text/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp @@ -265,8 +265,8 @@ class CharStarContainer { const char *str; public: - explicit Q_DECL_CONSTEXPR CharStarContainer(const char *s = nullptr) : str(s) {} - Q_DECL_CONSTEXPR operator const char *() const { return str; } + explicit constexpr CharStarContainer(const char *s = nullptr) : str(s) {} + constexpr operator const char *() const { return str; } }; } // unnamed namespace diff --git a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp index 3e1f10cc11..2716ee2c8d 100644 --- a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp +++ b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp @@ -82,7 +82,7 @@ MAKE_ALL(const char*, QChar) #undef MAKE_RELOP // END FIXME -static Q_DECL_CONSTEXPR int sign(int i) noexcept +static constexpr int sign(int i) noexcept { return i < 0 ? -1 : i > 0 ? +1 : diff --git a/tests/auto/corelib/text/qstringview/tst_qstringview.cpp b/tests/auto/corelib/text/qstringview/tst_qstringview.cpp index 55e23570d7..a7f39412a8 100644 --- a/tests/auto/corelib/text/qstringview/tst_qstringview.cpp +++ b/tests/auto/corelib/text/qstringview/tst_qstringview.cpp @@ -126,7 +126,7 @@ static_assert(!CanConvert<std::list<char16_t>>::value); // wchar_t // -Q_CONSTEXPR bool CanConvertFromWCharT = +constexpr bool CanConvertFromWCharT = #ifdef Q_OS_WIN true #else |