File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments