Skip to content

Commit 7521123

Browse files
committed
fix FP in selfcheck
1 parent 33764cc commit 7521123

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/checkclass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,15 +473,15 @@ void CheckClassImpl::copyconstructors()
473473
if (Token::Match(tok, "%var% ( new") ||
474474
(Token::Match(tok, "%var% ( %name% (") && mSettings.library.getAllocFuncInfo(tok->tokAt(2)))) {
475475
const Variable* var = tok->variable();
476-
if (var && var->scope() == scope)
476+
if (var && var->scope() == scope && !(var->valueType() && var->valueType()->type == ValueType::SMART_POINTER))
477477
allocatedVars[tok->varId()] = tok;
478478
}
479479
}
480480
for (const Token* const end = func.functionScope->bodyEnd; tok != end; tok = tok->next()) {
481481
if (Token::Match(tok, "%var% = new") ||
482482
(Token::Match(tok, "%var% = %name% (") && mSettings.library.getAllocFuncInfo(tok->tokAt(2)))) {
483483
const Variable* var = tok->variable();
484-
if (var && var->scope() == scope && !var->isStatic())
484+
if (var && var->scope() == scope && !var->isStatic() && !(var->valueType() && var->valueType()->type == ValueType::SMART_POINTER))
485485
allocatedVars[tok->varId()] = tok;
486486
}
487487
}

0 commit comments

Comments
 (0)