Skip to content

Commit c93cfd7

Browse files
committed
startToken
1 parent 8129831 commit c93cfd7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/checkunusedvar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,7 @@ void CheckUnusedVar::checkStructMemberUsage()
16041604
if (scope.type == ScopeType::eStruct && scope.nestedIn && scope.nestedIn->type == ScopeType::eUnion) {
16051605
bool structMemberUsed = false;
16061606

1607-
for (const Token *tok = mTokenizer->tokens(); tok; tok = tok->next()) {
1607+
for (const Token *tok = scope.nestedIn->bodyStart; tok; tok = tok->next()) {
16081608
if (tok->variable() && tok != tok->variable()->nameToken() && tok->variable()->scope() == &scope) {
16091609
structMemberUsed = true;
16101610
break;

0 commit comments

Comments
 (0)