From 1318232c051084d2734d426a8c4f2b6d22a245d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Mon, 16 Sep 2024 13:35:25 +0200 Subject: [PATCH] tst_QBuffer: fix warning about overflow The constexpr in the if is ignored here, use #if instead Change-Id: I9a81955e53e9da72e2302e128bf86b03eaf846e7 Reviewed-by: Marc Mutz --- tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp b/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp index 56c428989a2..0876efdc021 100644 --- a/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp +++ b/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp @@ -301,7 +301,7 @@ void tst_QBuffer::invalidSeeks() buffer.open(QIODevice::WriteOnly); QCOMPARE(buffer.buffer().size(), qsizetype(0)); QCOMPARE(buffer.pos(), qint64(0)); - constexpr qint64 MaxQByteArrayCapacity = (std::numeric_limits::max)(); + constexpr qint64 MaxQByteArrayCapacity = (std::numeric_limits::max)(); // this should fail fast, not after trying to allocate nearly 2 GiB of data, // potentially crashing in the process: QVERIFY(!buffer.seek(2 * MaxQByteArrayCapacity - 1));