From 2c56f9f69be51ccbb2a79c7c2b6bdb0d9b212ae0 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Thu, 26 Jun 2025 08:02:06 -0400 Subject: [PATCH] cfg/qt.cfg - make QDate::isValid() const to solve a false positive: ``` QDate date; Q_ASSERT(date.isValid()); ``` reports assertWithSideEffect --- cfg/qt.cfg | 1 + test/cfg/qt.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/cfg/qt.cfg b/cfg/qt.cfg index 3578cbe70f8..12f31c4d0f6 100644 --- a/cfg/qt.cfg +++ b/cfg/qt.cfg @@ -2737,6 +2737,7 @@ + diff --git a/test/cfg/qt.cpp b/test/cfg/qt.cpp index e1c44398868..a91549a4dad 100644 --- a/test/cfg/qt.cpp +++ b/test/cfg/qt.cpp @@ -847,3 +847,10 @@ namespace { // cppcheck-suppress functionStatic void TestUnusedFunction::doStuff() {} // Should not warn here with unusedFunction } + +int qdateIsValid() +{ + QDate qd(1,1,2025); + Q_ASSERT(qd.isValid()); // Should not warn here with assertWithSideEffect + return qd.month(); +}