diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 92bc65172..a123ff237 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -2018,7 +2018,6 @@ void CheckClass::initializerListError(const Token *tok1, const Token *tok2, cons void CheckClass::checkSelfInitialization() { - const SymbolDatabase *symbolDatabase = _tokenizer->getSymbolDatabase(); for (std::size_t i = 0; i < symbolDatabase->functionScopes.size(); ++i) { const Scope* scope = symbolDatabase->functionScopes[i]; const Function* function = scope->function; @@ -2037,9 +2036,9 @@ void CheckClass::checkSelfInitialization() } } -void CheckClass::selfInitializationError(const Token* tok, const std::string& name) +void CheckClass::selfInitializationError(const Token* tok, const std::string& varname) { - reportError(tok, Severity::error, "selfInitialization", "Member variable '" + name + "' is initialized by itself."); + reportError(tok, Severity::error, "selfInitialization", "Member variable '" + varname + "' is initialized by itself."); } diff --git a/lib/checkclass.h b/lib/checkclass.h index 717ab2ad3..a6c8a2c25 100644 --- a/lib/checkclass.h +++ b/lib/checkclass.h @@ -155,7 +155,7 @@ private: void checkConstError2(const Token *tok1, const Token *tok2, const std::string &classname, const std::string &funcname, bool suggestStatic); void initializerListError(const Token *tok1,const Token *tok2, const std::string & classname, const std::string &varname); void suggestInitializationList(const Token *tok, const std::string& varname); - void selfInitializationError(const Token* tok, const std::string& name); + void selfInitializationError(const Token* tok, const std::string& varname); void callsPureVirtualFunctionError(const Function & scopeFunction, const std::list & tokStack, const std::string &purefuncname); void duplInheritedMembersError(const Token* tok1, const Token* tok2, const std::string &derivedname, const std::string &basename, const std::string &variablename, bool derivedIsStruct, bool baseIsStruct); diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 7ff2e38bb..4c2f335d8 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -111,7 +111,7 @@ Token *Tokenizer::copyTokens(Token *dest, const Token *first, const Token *last, tok2->fileIndex(commonFileIndex); tok2->linenr(linenrs); tok2->type(tok->type()); - tok2->flags(tok2->flags()); + tok2->flags(tok->flags()); tok2->varId(tok->varId()); // Check for links and fix them up