Commit Graph

9710 Commits

Author SHA1 Message Date
Rikard Falkeborn 9afeef01c6 Improve duplicateExpressionTernary (#2484)
Test both the cases where sizeof(int) == sizeof(long) and when they are
different to improve testing.
2020-01-10 10:02:50 +01:00
fuzzelhjb fcd5cda97f Check selected files from project (#2378) 2020-01-10 08:57:37 +01:00
Daniel Marjamäki b8aa71bc87 Clang import; CXXStaticCast 2020-01-09 20:53:06 +01:00
Daniel Marjamäki bf62138237 Verification; Remove VERIFY_UNINIT define, the checking is always compiled from now on 2020-01-09 20:25:52 +01:00
Daniel Marjamäki ae5dbe0575 Clang import; UnaryOperator 2020-01-09 19:07:14 +01:00
Daniel Marjamäki 2137f1ead9 Clang import; reference before declaration 2020-01-09 18:03:24 +01:00
Daniel Marjamäki d842f00aef Clang import; UnaryExprOrTypeTraitExpr 2020-01-09 17:31:46 +01:00
Daniel Marjamäki 7daa1bc11d Clang import: CharacterLiteral 2020-01-09 16:54:45 +01:00
Daniel Marjamäki fea981211e Clang import; CXXBoolLiteralExpr 2020-01-09 16:19:38 +01:00
Dmitry-Me 9d8f67a6ca Improve test coverage for MathLib::calculate() 2020-01-09 18:18:03 +03:00
Daniel Marjamäki e6b873b7b9 Clang import; CXXOperatorCallExpr 2020-01-09 15:59:22 +01:00
Daniel Marjamäki 060c695f80 Clang import; CXXConstructorDecl, CXXThisExpr 2020-01-09 13:19:14 +01:00
Daniel Marjamäki 1589ac5352 Clang import; Set links properly 2020-01-09 12:42:29 +01:00
Daniel Marjamäki 0becff9d7f testsuites/danmar-verify: Add divbyzero tests 2020-01-09 10:48:43 +01:00
Ken-Patrick Lehrmann 0b7649ca9b Fix 9298 (#2476)
* Fix 9298

Tell cppcheck that strcpy returns its first argument, and use that
knowledge in checkTokenInsideExpression.

* Add missing unit tests in cmake
2020-01-09 08:47:36 +01:00
Maksim Derbasov 872d531568 Removing check hidingInheritedPublic (#2482) 2020-01-09 06:53:08 +01:00
Daniel Marjamäki 4e8a922e18 Clang import; CXXMemberCall 2020-01-08 21:49:23 +01:00
Daniel Marjamäki 3387ee3512 Clang import; ClassTemplateDecl 2020-01-08 21:31:06 +01:00
Daniel Marjamäki eb3270959e Clang import; FunctionTemplateDecl 2020-01-08 20:47:52 +01:00
Daniel Marjamäki 64953f36b3 Clang import: CXXRecordDecl, CXXMethodDecl 2020-01-08 19:32:04 +01:00
Daniel Marjamäki 54a9b61329 Clang import; NamespaceDecl, varDecl4, varDecl5 2020-01-08 18:23:40 +01:00
Daniel Marjamäki b8ae957365 Clang import; fwrite FunctionDecl 2020-01-08 16:42:21 +01:00
Daniel Marjamäki c4c929a6a7 Clang import: StringLiteral, funcdecl3, determine includes with clang -v 2020-01-08 16:36:51 +01:00
Daniel Marjamäki f51048e03b Clang Import; TypedefDecl 2020-01-08 14:25:09 +01:00
Daniel Marjamäki e6ee29fd11 Clang import; BreakStmt, ContinueStmt 2020-01-08 12:29:54 +01:00
Daniel Marjamäki ea414e46e1 Clang import; WhileStmt 2020-01-08 12:19:48 +01:00
Daniel Marjamäki 61039023b2 Clang import; ForStmt 2020-01-08 10:35:44 +01:00
Daniel Marjamäki 4b7e6c68b0 Clang import; MemberExpr 2020-01-08 09:51:35 +01:00
Daniel Marjamäki e5b99d3299 Clang import; Refactoring 2020-01-07 19:47:06 +01:00
Daniel Marjamäki a3abc75ca1 Clang import; RecordDecl 2020-01-07 18:33:24 +01:00
Daniel Marjamäki c4131bbc5b Clang import; else 2020-01-07 12:38:37 +01:00
Daniel Marjamäki b829c4cebb Clang import; Arrays 2020-01-07 12:19:06 +01:00
Daniel Marjamäki 6a4a59b783 Clang Import; Added test 2020-01-06 16:45:18 +01:00
amai2012 b621c35539 Astyle formatting [ci skip] 2020-01-05 17:00:34 +01:00
Paul Fultz II 90f82d0374 Fix issue 9541: false negative: knownConditionTrueFalse (#2473)
* Fix issue 9541: false negative: knownConditionTrueFalse

* Add another test case

* Add another test

* Fix FPs

* Format

* Fix compile error

* Remove double conditions

* Fix compile error
2020-01-05 16:25:33 +01:00
Ken-Patrick Lehrmann 5f73e1cb32 Fix 9546: properly check that the bound is the size (#2475)
Previously, as the check was done on the token and not on the ast,
`i <= v.size()` and `i <= v.size() - 2` would both raise the same
warning.

This patch fixes this, but this mean the check is only done when the
condition if `i <= v.size()`. Any other (more complex) condition is
ignore, and so we have false negative for instance with
 `i <= v.size() + 1`.
2020-01-05 16:24:25 +01:00
Maksim Derbasov a3ed9116e5 Clarify error msg for hidingInheritedPublic (#2474) 2020-01-05 09:32:39 +01:00
Paul Fultz II e1a97c524d Fix issue 9554: False positive: The address of local variable 'x' is accessed at non-zero index. (#2470)
* Fix issue 9554: False positive: The address of local variable 'x' is accessed at non-zero index.

* Format

* Remove unnecesary condition check
2020-01-04 11:39:52 +01:00
Ken-Patrick Lehrmann a9d423eef2 Fix #8938: FP identicalInnerCondition (#2471) 2020-01-04 11:38:56 +01:00
Ken-Patrick Lehrmann eca7ee9260 9356: Prevent false positive when passing non-const reference to member constructor (#2370)
* Add cases for 9356

* 9356: Prevent false positive when passing non-const reference to member constructor

This workarounds false positives 'Parameter  can be declared with const [constParameter]'
when said parameter is used in constructor call. It assume the
constructor call might change the parameter (without any checks.
The drawback is that we have false negative, in cases where we could
check the constructor actually takes a const reference, or a copied by
value parameter.

* Add todo comment in isVariableMutableInInitializer
2020-01-04 11:36:45 +01:00
Paul Fultz II e07801a891 Fix issue 9563: new daca crash: findLambdaEndToken not finding end token (#2472) 2020-01-04 10:45:24 +01:00
orbitcowboy ce0f7e201d Formatted 'wxwidgets.cfg: Added support for more interfaces.' 2020-01-04 00:26:39 +01:00
orbitcowboy 1e0f8ae9b4 Running astyle [ci skip]. 2020-01-04 00:06:27 +01:00
Paul Fultz II dd05839a7e Fix false positives in knownConditionTrueFalse when using expressions with const variables (#2469) 2020-01-03 19:35:28 +01:00
Maksim Derbasov fc5fd3c40c Check that virtual function non-narrow access modifier in derived class (#2229)
* Check that virtual function has not narrowed access in derived class

* motivation info added

* error reporting moved to func

* added suppression for CI
2020-01-01 16:09:43 +01:00
Rikard Falkeborn 7514544d94 Fix #8758 (add syntax error for invalid code) (#2466) 2020-01-01 15:46:09 +01:00
Daniel Marjamäki f23d880a7e Verification; use <uninit> configuration 2020-01-01 14:37:20 +01:00
Paul Fultz II 30b9455e89 Fix issue 9556: FP mismatchingContainers: raw pointer comparison (#2465)
* Fix issue 9556: FP mismatchingContainers: raw pointer comparison

* Formatting
2020-01-01 12:02:21 +01:00
Daniel Marjamäki d4ec8075a4 Verification; Fix false positive in while loops 2019-12-31 22:32:16 +01:00
Daniel Marjamäki 043634be27 Verification; Better handling of assignment in while 2019-12-31 20:31:31 +01:00