Skip to content

Commit 578d3c3

Browse files
committed
Fixed #8723: False negative: Same expression with methods
1 parent a6c98e9 commit 578d3c3

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

cfg/qt.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,7 @@
945945
<function name="QString::compare">
946946
<noreturn>false</noreturn>
947947
<returnValue type="int"/>
948+
<const/>
948949
<use-retval/>
949950
<leak-ignore/>
950951
<arg nr="1" direction="in">

test/cfg/qt.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,13 @@ QVector<int>::iterator QVector2()
279279
return it;
280280
}
281281

282+
void duplicateExpression_QString_Compare(QString style) //#8723
283+
{
284+
// cppcheck-suppress duplicateExpression
285+
if (style.compare( "x", Qt::CaseInsensitive ) == 0 || style.compare( "x", Qt::CaseInsensitive ) == 0)
286+
{}
287+
}
288+
282289
void QStack1(QStack<int> intStackArg)
283290
{
284291
for (int i = 0; i <= intStackArg.size(); ++i) {

0 commit comments

Comments
 (0)