From b6d2c1b23807290600c15f89374d0242881535fd Mon Sep 17 00:00:00 2001 From: Ken-Patrick Lehrmann Date: Sun, 5 Jan 2020 21:10:48 +0100 Subject: [PATCH] Fix github CI (#2477) * Fix github CI ``` Checking lib/check.cpp: __CPPCHECK__=1... lib/symboldatabase.h:719:5: warning: Class 'Function' has a constructor with 1 argument that is not explicit. [noExplicitConstructor] Function(const Token *tokenDef); ^ Checking lib/templatesimplifier.cpp: __CPPCHECK__=1... lib/symboldatabase.cpp:1754:33: warning: Condition 'settings' is always true [knownConditionTrueFalse] const Library * const lib = settings ? &settings->library : nullptr; ^ lib/symboldatabase.cpp:1751:9: note: Assuming that condition '!settings' is not redundant if (!settings) ^ lib/symboldatabase.cpp:1754:33: note: Condition 'settings' is always true const Library * const lib = settings ? &settings->library : nullptr; ``` * Compile parseClangAstDump --- lib/cppcheck.vcxproj | 3 ++- lib/cppcheck.vcxproj.filters | 8 +++++++- lib/symboldatabase.cpp | 2 +- lib/symboldatabase.h | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/cppcheck.vcxproj b/lib/cppcheck.vcxproj index d3b8ef297..e6d141b5a 100644 --- a/lib/cppcheck.vcxproj +++ b/lib/cppcheck.vcxproj @@ -129,6 +129,7 @@ + @@ -556,4 +557,4 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y - \ No newline at end of file + diff --git a/lib/cppcheck.vcxproj.filters b/lib/cppcheck.vcxproj.filters index f41796ad1..931e16ca1 100644 --- a/lib/cppcheck.vcxproj.filters +++ b/lib/cppcheck.vcxproj.filters @@ -167,6 +167,9 @@ Source Files + + Source Files + @@ -325,6 +328,9 @@ Header Files + + Header Files + @@ -332,4 +338,4 @@ - \ No newline at end of file + diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 82b0cb073..85866344f 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -1751,7 +1751,7 @@ void Variable::evaluate(const Settings* settings) if (!settings) return; - const Library * const lib = settings ? &settings->library : nullptr; + const Library * const lib = &settings->library; if (mNameToken) setFlag(fIsArray, arrayDimensions(settings)); diff --git a/lib/symboldatabase.h b/lib/symboldatabase.h index 4338ee49b..5707cf5e9 100644 --- a/lib/symboldatabase.h +++ b/lib/symboldatabase.h @@ -716,7 +716,7 @@ public: enum Type { eConstructor, eCopyConstructor, eMoveConstructor, eOperatorEqual, eDestructor, eFunction, eLambda }; Function(const Tokenizer *mTokenizer, const Token *tok, const Scope *scope, const Token *tokDef, const Token *tokArgDef); - Function(const Token *tokenDef); + explicit Function(const Token *tokenDef); const std::string &name() const { return tokenDef->str();