File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -437,7 +437,7 @@ void CheckClass::copyconstructors()
437437 }
438438 } else if (func.type == FunctionType::eDestructor && func.functionScope ) {
439439 // Deallocations in destructors
440- const Token* tok = func.token -> linkAt ( 1 ) ;
440+ const Token* tok = func.functionScope -> bodyStart ;
441441 for (const Token* const end = func.functionScope ->bodyEnd ; tok != end; tok = tok->next ()) {
442442 if (Token::Match (tok, " delete %var%" ) ||
443443 (Token::Match (tok, " %name% ( %var%" ) && mSettings ->library .getDeallocFuncInfo (tok))) {
@@ -450,8 +450,8 @@ void CheckClass::copyconstructors()
450450 }
451451 }
452452
453- bool hasAllocatedVars = !allocatedVars.empty ();
454- bool hasDeallocatedVars = !deallocatedVars.empty ();
453+ const bool hasAllocatedVars = !allocatedVars.empty ();
454+ const bool hasDeallocatedVars = !deallocatedVars.empty ();
455455
456456 if (hasAllocatedVars || hasDeallocatedVars) {
457457 const Function *funcCopyCtor = nullptr ;
Original file line number Diff line number Diff line change @@ -2632,8 +2632,6 @@ const ValueFlow::Value* Token::getContainerSizeValue(const MathLib::bigint val)
26322632
26332633TokenImpl::~TokenImpl ()
26342634{
2635- // cppcheck-suppress-begin [noCopyConstructor, noOperatorEq]
2636-
26372635 delete mMacroName ;
26382636 delete mOriginalName ;
26392637 delete mValueType ;
@@ -2651,8 +2649,6 @@ TokenImpl::~TokenImpl()
26512649 mCppcheckAttributes = mCppcheckAttributes ->next ;
26522650 delete c;
26532651 }
2654-
2655- // cppcheck-suppress-end [noCopyConstructor, noOperatorEq]
26562652}
26572653
26582654void TokenImpl::setCppcheckAttribute (TokenImpl::CppcheckAttributes::Type type, MathLib::bigint value)
Original file line number Diff line number Diff line change @@ -147,6 +147,9 @@ struct TokenImpl {
147147 TokenImpl () : mFunction (nullptr ) {}
148148
149149 ~TokenImpl ();
150+
151+ TokenImpl (const TokenImpl &) = delete ;
152+ TokenImpl operator =(const TokenImpl &) = delete ;
150153};
151154
152155// / @addtogroup Core
You can’t perform that action at this time.
0 commit comments