Skip to content

Commit 1380219

Browse files
committed
fix
1 parent 0357bb6 commit 1380219

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

lib/checkother.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,21 @@ void CheckOther::checkPassByReference()
15911591
if (var->isArray() && (!var->isStlType() || Token::simpleMatch(var->nameToken()->next(), "[")))
15921592
continue;
15931593

1594+
if (var->isArgument()) {
1595+
const Token *tok = var->typeStartToken();
1596+
for (; tok; tok = tok->next()) {
1597+
if (Token::simpleMatch(tok, "(")) {
1598+
tok = tok->link();
1599+
continue;
1600+
}
1601+
if (Token::simpleMatch(tok, ")"))
1602+
break;
1603+
}
1604+
1605+
if (Token::simpleMatch(tok, ") ;"))
1606+
continue;
1607+
}
1608+
15941609
const bool isConst = var->isConst();
15951610
if (isConst) {
15961611
passedByValueError(var, inconclusive, isRangeBasedFor);

0 commit comments

Comments
 (0)