We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc33aee commit 729a96bCopy full SHA for 729a96b
1 file changed
lib/checkunusedvar.cpp
@@ -1641,7 +1641,7 @@ void CheckUnusedVar::checkStructMemberUsage()
1641
1642
for (const Variable &var : scope.varlist) {
1643
// only warn for variables without side effects
1644
- if (!var.typeStartToken()->isStandardType() && !var.isPointer() && !astIsContainer(var.nameToken()) && !mTokenizer->getSymbolDatabase()->isRecordTypeWithoutSideEffects(var.type()))
+ if (!(var.valueType() && var.valueType()->type >= ValueType::VOID) && !var.isPointer() && !astIsContainer(var.nameToken()) && !mTokenizer->getSymbolDatabase()->isRecordTypeWithoutSideEffects(var.type()))
1645
continue;
1646
if (isInherited && !var.isPrivate())
1647
0 commit comments