Skip to content

Commit f861723

Browse files
committed
fix #14643
1 parent c209a77 commit f861723

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

lib/checkunusedvar.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,13 @@ void CheckUnusedVar::checkFunctionVariableUsage()
13521352
if (tok->previous() && tok->previous()->variable() && tok->previous()->variable()->nameToken()->scope()->type == ScopeType::eUnion)
13531353
continue;
13541354

1355+
if (expr->valueType() &&
1356+
expr->valueType()->type == ValueType::RECORD &&
1357+
expr->valueType()->typeScope &&
1358+
expr->valueType()->typeScope->definedType &&
1359+
!symbolDatabase->isRecordTypeWithoutSideEffects(expr->valueType()->typeScope->definedType))
1360+
continue;
1361+
13551362
FwdAnalysis fwdAnalysis(*mSettings);
13561363
const Token* scopeEnd = ValueFlow::getEndOfExprScope(expr, scope, /*smallest*/ false);
13571364
if (fwdAnalysis.unusedValue(expr, start, scopeEnd)) {

0 commit comments

Comments
 (0)