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
This commit is contained in:
Ken-Patrick Lehrmann 2020-01-05 21:10:48 +01:00 committed by Daniel Marjamäki
parent 07cc3e47c4
commit b6d2c1b238
4 changed files with 11 additions and 4 deletions

View File

@ -129,6 +129,7 @@
<ClInclude Include="checkunusedfunctions.h" />
<ClInclude Include="checkunusedvar.h" />
<ClInclude Include="checkvaarg.h" />
<ClInclude Include="clangastdump.h" />
<ClInclude Include="config.h" />
<ClInclude Include="cppcheck.h" />
<ClInclude Include="ctu.h" />
@ -556,4 +557,4 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y</Command>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>
</Project>

View File

@ -167,6 +167,9 @@
<ClCompile Include="programmemory.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="clangastdump.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="checkbufferoverrun.h">
@ -325,6 +328,9 @@
<ClInclude Include="ctu.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="clangastdump.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="version.rc" />
@ -332,4 +338,4 @@
<ItemGroup>
<Natvis Include="cppcheck.natvis" />
</ItemGroup>
</Project>
</Project>

View File

@ -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));

View File

@ -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();