Skip to content

Commit 31c1fc2

Browse files
committed
fix
1 parent d8c60bc commit 31c1fc2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎lib/checkunusedvar.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,11 @@ void CheckUnusedVarImpl::checkFunctionVariableUsage()
12881288
while (Token::Match(op1tok, ".|[|*"))
12891289
op1tok = op1tok->astOperand1();
12901290

1291+
// Bail out for overloaded indexing
1292+
if (op1tok && op1tok->valueType() && op1tok->valueType()->pointer == 0 &&
1293+
op1tok->valueType()->type == ValueType::Type::RECORD && Token::simpleMatch(op1tok->astParent(), "["))
1294+
continue;
1295+
12911296
// Assignment in macro => do not warn
12921297
if (isAssignment && tok->isExpandedMacro() && op1tok && op1tok->isExpandedMacro())
12931298
continue;

0 commit comments

Comments
 (0)