diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index b6febc9e3..3301947fe 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -243,7 +243,7 @@ void CheckClass::checkExplicitConstructors() for (std::list::const_iterator func = scope->functionList.begin(); func != scope->functionList.end(); ++func) { // We are looking for constructors, which are meeting following criteria: - // 1) Constructor is declared with a single parameter + // 1) Constructor is declared with a single parameter // 2) Constructor is not declared as explicit // 3) It is not a copy/move constructor of non-abstract class // 4) Constructor is not marked as delete (programmer can mark the default constructor as deleted, which is ok) @@ -254,8 +254,7 @@ void CheckClass::checkExplicitConstructors() // We must decide, if it is not a copy/move constructor, or it is a copy/move constructor of abstract class. if (func->type != Function::eCopyConstructor && func->type != Function::eMoveConstructor) { noExplicitConstructorError(func->tokenDef, scope->className, scope->type == Scope::eStruct); - } - else if (isAbstractClass) { + } else if (isAbstractClass) { noExplicitCopyMoveConstructorError(func->tokenDef, scope->className, scope->type == Scope::eStruct); } } diff --git a/lib/symboldatabase.h b/lib/symboldatabase.h index 8091c425e..094c513c8 100644 --- a/lib/symboldatabase.h +++ b/lib/symboldatabase.h @@ -770,7 +770,7 @@ public: static bool argsMatch(const Scope *info, const Token *first, const Token *second, const std::string &path, unsigned int depth); private: - bool isImplicitlyVirtual_rec(const ::Type* type, bool& safe) const; + bool isImplicitlyVirtual_rec(const ::Type* baseType, bool& safe) const; unsigned int flags; }; diff --git a/test/testclass.cpp b/test/testclass.cpp index 48c435e2d..beafd1e3e 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -223,12 +223,12 @@ private: ASSERT_EQUALS("", errout.str()); checkExplicitConstructors("class Class \n" - "{ \n" - " Class() = delete; \n" - " Class(const Class& other) = delete; \n" - " Class(Class&& other) = delete; \n" - " virtual int i() = 0; \n" - "};"); + "{ \n" + " Class() = delete; \n" + " Class(const Class& other) = delete; \n" + " Class(Class&& other) = delete; \n" + " virtual int i() = 0; \n" + "};"); ASSERT_EQUALS("", errout.str()); checkExplicitConstructors("class Class \n"