diff options
Diffstat (limited to 'tests/auto/corelib/text/qbytearrayview/tst_qbytearrayview.cpp')
-rw-r--r-- | tests/auto/corelib/text/qbytearrayview/tst_qbytearrayview.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/auto/corelib/text/qbytearrayview/tst_qbytearrayview.cpp b/tests/auto/corelib/text/qbytearrayview/tst_qbytearrayview.cpp index 894f0430dd..702e1840da 100644 --- a/tests/auto/corelib/text/qbytearrayview/tst_qbytearrayview.cpp +++ b/tests/auto/corelib/text/qbytearrayview/tst_qbytearrayview.cpp @@ -262,10 +262,9 @@ void tst_QByteArrayView::constExpr() const static_assert(!bv2.empty()); static_assert(bv2.size() == 5); } -#if !defined(Q_CC_GNU) || defined(Q_CC_CLANG) +#if !defined(Q_CC_GNU_ONLY) || !defined(QT_SANITIZE_UNDEFINED) // Below checks are disabled because of a compilation issue with GCC and // -fsanitize=undefined. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71962. - // Note: Q_CC_GNU is also defined for Clang, so we need to check that too. { static constexpr char hello[] = "Hello"; constexpr QByteArrayView bv(hello); @@ -307,6 +306,9 @@ void tst_QByteArrayView::constExpr() const static_assert(bv.back() == 'o'); static_assert(bv.last() == 'o'); + constexpr auto bv2 = QByteArrayView::fromArray(hello); + QCOMPARE_EQ(bv, bv2); + constexpr std::string_view sv = bv; static_assert(bv.size() == sv.size()); #ifdef AMBIGUOUS_CALL // QTBUG-108805 @@ -416,7 +418,7 @@ void tst_QByteArrayView::fromArray() const { static constexpr char hello[] = "Hello\0abc\0\0."; - constexpr QByteArrayView bv = QByteArrayView::fromArray(hello); + const QByteArrayView bv = QByteArrayView::fromArray(hello); QCOMPARE(bv.size(), 13); QVERIFY(!bv.empty()); QVERIFY(!bv.isEmpty()); |