From 8fd17546ad99fb8c6fe1a06ecd4cc9ebf6940256 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 26 Feb 2020 10:53:03 +0100 Subject: [PATCH] qt.cfg: #9650: Fix missing configuration for QString.chop() (#2556) chop() and also remove() change the size of a QString, so they have to be added in the container configuration accordingly to avoid false positives. --- cfg/qt.cfg | 2 ++ test/cfg/qt.cpp | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/cfg/qt.cfg b/cfg/qt.cfg index 8346ff281..92a7741f6 100644 --- a/cfg/qt.cfg +++ b/cfg/qt.cfg @@ -4969,6 +4969,8 @@ + + diff --git a/test/cfg/qt.cpp b/test/cfg/qt.cpp index a35b9ac24..c8ef06ef2 100644 --- a/test/cfg/qt.cpp +++ b/test/cfg/qt.cpp @@ -379,7 +379,7 @@ void MacroTest2_test() #endif } -void validCode(int * pIntPtr) +void validCode(int * pIntPtr, QString & qstrArg) { if (QFile::exists("test")) { } @@ -404,6 +404,19 @@ void validCode(int * pIntPtr) Q_DECLARE_LOGGING_CATEGORY(logging_category_test); QT_FORWARD_DECLARE_CLASS(forwardDeclaredClass); QT_FORWARD_DECLARE_STRUCT(forwardDeclaredStruct); + + //#9650 + QString qstr1(qstrArg); + if (qstr1.length() == 1) { + } else { + qstr1.chop(1); + if (qstr1.length() == 1) {} + } + if (qstr1.length() == 1) { + } else { + qstr1.remove(1); + if (qstr1.length() == 1) {} + } } void ignoredReturnValue()