We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0357bb6 commit 1380219Copy full SHA for 1380219
1 file changed
lib/checkother.cpp
@@ -1591,6 +1591,21 @@ void CheckOther::checkPassByReference()
1591
if (var->isArray() && (!var->isStlType() || Token::simpleMatch(var->nameToken()->next(), "[")))
1592
continue;
1593
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
1607
1608
1609
const bool isConst = var->isConst();
1610
if (isConst) {
1611
passedByValueError(var, inconclusive, isRangeBasedFor);
0 commit comments