Ran AStyle, fixed VS2015 warning in symboldatabase.h

This commit is contained in:
PKEuS 2015-03-11 20:26:53 +01:00
parent 9bafa3bf25
commit cd84d78e92
3 changed files with 9 additions and 10 deletions

View File

@ -243,7 +243,7 @@ void CheckClass::checkExplicitConstructors()
for (std::list<Function>::const_iterator func = scope->functionList.begin(); func != scope->functionList.end(); ++func) { for (std::list<Function>::const_iterator func = scope->functionList.begin(); func != scope->functionList.end(); ++func) {
// We are looking for constructors, which are meeting following criteria: // 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 // 2) Constructor is not declared as explicit
// 3) It is not a copy/move constructor of non-abstract class // 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) // 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. // 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) { if (func->type != Function::eCopyConstructor && func->type != Function::eMoveConstructor) {
noExplicitConstructorError(func->tokenDef, scope->className, scope->type == Scope::eStruct); noExplicitConstructorError(func->tokenDef, scope->className, scope->type == Scope::eStruct);
} } else if (isAbstractClass) {
else if (isAbstractClass) {
noExplicitCopyMoveConstructorError(func->tokenDef, scope->className, scope->type == Scope::eStruct); noExplicitCopyMoveConstructorError(func->tokenDef, scope->className, scope->type == Scope::eStruct);
} }
} }

View File

@ -770,7 +770,7 @@ public:
static bool argsMatch(const Scope *info, const Token *first, const Token *second, const std::string &path, unsigned int depth); static bool argsMatch(const Scope *info, const Token *first, const Token *second, const std::string &path, unsigned int depth);
private: private:
bool isImplicitlyVirtual_rec(const ::Type* type, bool& safe) const; bool isImplicitlyVirtual_rec(const ::Type* baseType, bool& safe) const;
unsigned int flags; unsigned int flags;
}; };

View File

@ -223,12 +223,12 @@ private:
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
checkExplicitConstructors("class Class \n" checkExplicitConstructors("class Class \n"
"{ \n" "{ \n"
" Class() = delete; \n" " Class() = delete; \n"
" Class(const Class& other) = delete; \n" " Class(const Class& other) = delete; \n"
" Class(Class&& other) = delete; \n" " Class(Class&& other) = delete; \n"
" virtual int i() = 0; \n" " virtual int i() = 0; \n"
"};"); "};");
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
checkExplicitConstructors("class Class \n" checkExplicitConstructors("class Class \n"