File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1680,6 +1680,29 @@ void CheckUnusedVarImpl::checkStructMemberUsage()
16801680 if (use)
16811681 break ;
16821682 }
1683+ // Class used in template with unknown definition
1684+ if (Token::Match (tok, " %name% <" ) && tok->next ()->link ()) {
1685+ if (tok->function ())
1686+ continue ;
1687+ if (tok->type () && tok->type ()->classScope )
1688+ continue ;
1689+ {
1690+ const Token *start = tok;
1691+ while (Token::Match (start->previous (), " %name%|::" ))
1692+ start = start->previous ();
1693+ if (mSettings .library .detectContainer (start))
1694+ continue ;
1695+ }
1696+ const Token *end = tok->next ()->link ();
1697+ for (; tok != end; tok = tok->next ()) {
1698+ if (tok->type () && tok->type ()->classScope == &scope) {
1699+ use = true ;
1700+ break ;
1701+ }
1702+ }
1703+ if (use)
1704+ break ;
1705+ }
16831706 if (tok->variable () != &var)
16841707 continue ;
16851708 if (tok != var.nameToken ()) {
You can’t perform that action at this time.
0 commit comments