diff --git a/lib/checkunusedvar.cpp b/lib/checkunusedvar.cpp index 59e7a7a06..0a8e5543e 100644 --- a/lib/checkunusedvar.cpp +++ b/lib/checkunusedvar.cpp @@ -1216,10 +1216,8 @@ void CheckUnusedVar::checkStructMemberUsage() continue; // Try to prevent false positives when struct members are not used directly. - if (Token::findmatch(tok, (structname + " *").c_str())) + if (Token::findmatch(tok, (structname + " %type%| *").c_str())) structname.clear(); - else if (Token::findmatch(tok, (structname + " %type% *").c_str())) - structname = ""; } if (tok->str() == "}")