From 578d3c3a9338eb039d0118590b6fbe7f9d55835a Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Fri, 17 Sep 2021 19:46:46 +0200 Subject: [PATCH] Fixed #8723: False negative: Same expression with methods --- 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 398544377..a5d4497a1 100644 --- a/cfg/qt.cfg +++ b/cfg/qt.cfg @@ -945,6 +945,7 @@ false + diff --git a/test/cfg/qt.cpp b/test/cfg/qt.cpp index 889001920..f559f0e1b 100644 --- a/test/cfg/qt.cpp +++ b/test/cfg/qt.cpp @@ -279,6 +279,13 @@ QVector::iterator QVector2() return it; } +void duplicateExpression_QString_Compare(QString style) //#8723 +{ + // cppcheck-suppress duplicateExpression + if (style.compare( "x", Qt::CaseInsensitive ) == 0 || style.compare( "x", Qt::CaseInsensitive ) == 0) + {} +} + void QStack1(QStack intStackArg) { for (int i = 0; i <= intStackArg.size(); ++i) {