File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1606,7 +1606,7 @@ void CheckUnusedVar::checkStructMemberUsage()
16061606 if (isInherited && !var.isPrivate ())
16071607 continue ;
16081608
1609- if (!var.nameToken () || var.nameToken ()->isAttributeUnused () || var.nameToken ()->isAnonymous ())
1609+ if (!var.nameToken () || var.nameToken ()->isAttributeUnused () || var.nameToken ()->isAttributeMaybeUnused () || var. nameToken ()-> isAnonymous ())
16101610 continue ;
16111611
16121612 if (mTokenizer ->isVarUsedInTemplate (var.declarationId ()))
Original file line number Diff line number Diff line change @@ -9542,7 +9542,15 @@ void Tokenizer::simplifyCPPAttribute()
95429542 Token* head = skipCPPOrAlignAttribute (tok)->next ();
95439543 while (isCPPAttribute (head) || isAlignAttribute (head))
95449544 head = skipCPPOrAlignAttribute (head)->next ();
9545- head->isAttributeMaybeUnused (true );
9545+ while (Token::Match (head->next (), " %name%|*|&|&&|const|static|inline|volatile" ))
9546+ head = head->next ();
9547+ if (Token::Match (head, " %name%" ))
9548+ head->isAttributeMaybeUnused (true );
9549+ else {
9550+ if (Token::Match (tok->previous (), " %name%" ) && Token::Match (tok->link (), " ] [;={]" )) {
9551+ tok->previous ()->isAttributeMaybeUnused (true );
9552+ }
9553+ }
95469554 } else if (Token::findsimplematch (tok->tokAt (2 ), " unused" , tok->link ())) {
95479555 Token* head = skipCPPOrAlignAttribute (tok)->next ();
95489556 while (isCPPAttribute (head) || isAlignAttribute (head))
You can’t perform that action at this time.
0 commit comments