From 892c125ff8a37234c1ac3cb5ac6b90bc14f0543c Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Sat, 19 May 2012 21:51:39 +0200 Subject: [PATCH] =?UTF-8?q?Fixed:=20lib/checkclass.cpp:538:85:=20warning:?= =?UTF-8?q?=20declaration=20of=20=E2=80=98name=E2=80=99=20shadows=20a=20me?= =?UTF-8?q?mber=20of=20'this'.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/checkclass.cpp | 6 +++--- lib/checkclass.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 0cd056e0b..f51318190 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -535,12 +535,12 @@ void CheckClass::initializationListUsage() } } -void CheckClass::suggestInitializationList(const Token* tok, const std::string& name) +void CheckClass::suggestInitializationList(const Token* tok, const std::string& varname) { - reportError(tok, Severity::performance, "useInitializationList", "Variable '" + name + "' is assigned in constructor body. Consider to perform initalization in initialization list.\n" + reportError(tok, Severity::performance, "useInitializationList", "Variable '" + varname + "' is assigned in constructor body. Consider to perform initalization in initialization list.\n" "When an object of a class is created, the constructors of all member variables are called consecutivly " "in the order the variables are declared, even if you don't explicitly write them to the initialization list. You " - "could avoid assigning '" + name + "' a value by passing the value to the constructor in the initialization list."); + "could avoid assigning '" + varname + "' a value by passing the value to the constructor in the initialization list."); } //--------------------------------------------------------------------------- diff --git a/lib/checkclass.h b/lib/checkclass.h index 7c09678aa..ecff4c957 100644 --- a/lib/checkclass.h +++ b/lib/checkclass.h @@ -125,7 +125,7 @@ private: void checkConstError(const Token *tok, const std::string &classname, const std::string &funcname); void checkConstError2(const Token *tok1, const Token *tok2, const std::string &classname, const std::string &funcname); void initializerListError(const Token *tok1,const Token *tok2, const std::string & classname, const std::string &varname); - void suggestInitializationList(const Token *tok, const std::string& name); + void suggestInitializationList(const Token *tok, const std::string& varname); void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const { CheckClass c(0, settings, errorLogger);