Commit Graph

1550 Commits

Author SHA1 Message Date
chrchr-github d717e62ec3
Fix Detect assignment to temporary ()
* Fix  Detect assignment to temporary

* Use AST

* Warn if type definition is not seen
2022-11-01 11:46:42 +01:00
chrchr-github 7b9c99003b
Improve unreachableCodeError: handle library functions ()
* Update templatesimplifier.cpp

* Add tests

* Improve unreachableCodeError message

* Update templatesimplifier.cpp

* Add tests

* Improve unreachableCodeError message

* Revert "Update templatesimplifier.cpp"

This reverts commit 3fd152ed4063772a5f162bd985c3d91bcc65eb55.

* Revert "Add tests"

This reverts commit e760ab51e66a0a2c3a0250caf4cf3b745db44d10.

* Improve unreachableCodeError: handle library functions

* Fix merge
2022-10-20 07:00:36 +02:00
chrchr-github 9c7b4c9540
Improve unreachableCodeError message ()
* Update templatesimplifier.cpp

* Add tests

* Improve unreachableCodeError message

* Update templatesimplifier.cpp

* Add tests

* Improve unreachableCodeError message

* Revert "Update templatesimplifier.cpp"

This reverts commit 3fd152ed4063772a5f162bd985c3d91bcc65eb55.

* Revert "Add tests"

This reverts commit e760ab51e66a0a2c3a0250caf4cf3b745db44d10.
2022-10-19 19:19:31 +02:00
chrchr-github 3273e51fd5
Fix FN useStlAlgorithm with iterators () 2022-10-16 13:46:26 +02:00
Oliver Stöneberg fa7e08a29f
optimized `CheckOther::checkDuplicateBranch()` a bit () 2022-10-09 20:48:54 +02:00
Oliver Stöneberg cff1cd9cda
applied clang-tidy `misc-const-correctness` fixes for POD types, iterators and references ()
* applied `misc-const-correctness` fixes for POD types and iterators

* applied `misc-const-correctness` fixes for references
2022-10-02 07:12:40 +02:00
chrchr-github 4d13266e99
Fix FN unusedScopedObject: temporary lock 'std::lock_guard<std::mutex>(m)' ()
* Fix  FN unusedScopedObject: temporary lock 'std::lock_guard<std::mutex>(m)'

* Format

* Fix cppcheck-cfg.rng

* Format
2022-09-30 07:25:33 +02:00
chrchr-github 2808fc615e
Fix "statement without effect" / FN unusedScopedObject does not work for classes in different namespace ()
* Partial fix for  unused variable without assignment not detected

* Add test for 

* Fix  FN unusedScopedObject does not work for classes in different namespace

* Merge

* Fix  "statement without effect" (unused variable without assignment) not detected

* Format
2022-09-24 12:49:37 +02:00
chrchr-github cb6f04a16c
Fix FP zerodivcond from enum definition / FP unassignedVariable with static variable ()
* Fix  FP zerodivcond from enum definition

* Simplify Boolean expression

* Fix  FP unassignedVariable with static variable
2022-09-17 18:50:07 +02:00
Oliver Stöneberg b3ec225480
iwyu.yml: use `debian:unstable` to always get latest include-what-you-use / cleaned up includes ()
* iwyu.yml: use debian:unstable to always get latest include-what-you-use

* cleaned up includes based on include-what-you-use

* mitigated include-what-you-use false positives
2022-09-16 07:15:49 +02:00
chrchr-github d1386a842a
Fix debug: constStatementError not handled. ()
* Fix  debug: constStatementError not handled.

* Use function
2022-09-14 23:57:02 +02:00
Paul Fultz II 43caa32abf
Fix 9755: false negative: access of moved variable in conditional code ()
* Fix 9755: false negative: access of moved variable in conditional code

* Format
2022-09-11 12:32:01 +02:00
Oliver Stöneberg d73a33d17e
avoid redundant `Token::declEndToken()` calls () 2022-08-20 20:50:14 +02:00
Oliver Stöneberg 16f598c409
added missing `sstream` includes () 2022-08-19 10:16:23 +02:00
chrchr-github 4a64e20592
unusedScopedObject: Don't warn for void statements ()
* Fix unusedScopedObject FPs

* Simplify

* Simplify

* Fix test

* Don't warn for void statements

* Format
2022-08-17 19:45:46 +02:00
chrchr-github 1a95515e47
Fix unusedScopedObject FPs () 2022-08-17 09:11:23 +02:00
chrchr-github 3dc2c0bd42
Fix FN constStatement with misused comma () 2022-08-16 22:10:58 +02:00
chrchr-github afef71f6b6
Partial fix for unused variable without assignment not detected ()
* Partial fix for  unused variable without assignment not detected

* Add test for 
2022-08-13 08:29:06 +02:00
chrchr-github a62c3ea90e
Fix Broken AST with auto**, FP constStatement () 2022-08-03 19:03:38 +02:00
Oliver Stöneberg efaaa58896
fixed some `modernize-use-emplace` false negatives and some `bugprone-assignment-in-if-condition` warnings () 2022-07-28 22:53:59 +02:00
chrchr-github 109a031ec7
Fix Add redundantContinue check () 2022-07-16 16:02:58 +02:00
PKEuS f3565e1056
Improvement: Support member variables in CheckOther::checkIncompleteArrayFill() ()
Merged from LCppC.
2022-07-12 19:43:48 +02:00
chrchr-github f5c4a21eae
Fix FN redundantCopyLocalConst () 2022-07-10 11:33:24 +02:00
Oliver Stöneberg c9c1f83a69
use `emptyString` more consistently () 2022-07-10 10:57:29 +02:00
Oliver Stöneberg b51aea5531
separated process execution code into `ProcessExecutor` () 2022-07-08 16:42:57 +02:00
chrchr-github 2223cd24b9
Fix FN: leakNoVarFunctionCall (switch condition) ()
* Fix  FN: leakNoVarFunctionCall

* Fix TODO

* Fix  FN: leakNoVarFunctionCall (if ( b && malloc ) )

*  FN: leakNoVarFunctionCall (ternary operator)

* Fix  FN: leakNoVarFunctionCall (switch condition)

* Fix FN constStatement

* Fix FP leakNoVarFunctionCall
2022-06-28 14:02:02 +02:00
chrchr-github 242afc389d
Fix Regression: Parameter \'ptr\' can be declared as pointer to const () 2022-06-25 21:42:55 +02:00
chrchr-github f1212e66f7
Fix FP constVariable with 2D array. ()
Test case  was actually a FP as well.
2022-06-22 21:22:04 +02:00
PKEuS 9eb16e1002
Replaced check for pipe() buffer size by ordinary CheckBufferOverrun, provide required Library configuration option ()
Merged from LCppC.
2022-06-19 12:01:55 +02:00
chrchr-github ecb24e28bc
Fix FP redundantCopyLocalConst - referenced variable changes () 2022-06-11 16:58:33 +02:00
chrchr-github 8579feb3aa
Fix FP redundantCopyLocalConst with modified object [inconclusive] ()
* Fix   FP redundantCopyLocalConst with modified object [inconclusive]

* Comment
2022-06-11 11:01:23 +02:00
PKEuS 1275b5275e
LCppC backport: Various optimizations ()
* Optimization: Use Token::eIncDecOp instead of expensive Token::Match calls

Merged from LCppC.

* Small Optimizations: - Moved a std::set that is only need during initialization of SymbolDatabase to function scope - Use std::vector instead of std::list

Merged from LCppC.

* Optimization: Refactorized various Token::Match calls and surrounding conditions

Merged from LCppC.

* Refactorization: Cleanup usage of std::multimap

Merged from LCppC.
2022-06-08 16:58:57 +02:00
chrchr-github e6f2929fac
Fix FN constVariable with range-based for () 2022-06-03 19:24:59 +02:00
chrchr-github cd7362e0e7
Fix FN with default init ()
* Fix  FP: variableScope when using range constructor to vector

* Format

* Fix FN with default init
2022-06-01 23:18:59 +02:00
chrchr-github 2452a2c01d
Fix FP: variableScope when using range constructor to vector ()
* Fix  FP: variableScope when using range constructor to vector

* Format
2022-06-01 21:15:41 +02:00
chrchr-github 7fbb9c7c13
Fix FN constVariable with range-based for loop ()
* Fix  FN constVariable with range-based for loop

* Format

* nullptr check

* Restrict scopes

* Add const

* Undo

* Add more const
2022-05-29 17:06:33 +02:00
chrchr-github e1c51940a2
Fix FP constParameter with decremented pointer () 2022-05-28 08:32:58 +02:00
chrchr-github 2ceaf308de
Fix : ValueType for pointer typedef, don't warn for typedef'd pointers, improve error message ()
* Fix ValueType for pointer typedef

* Add test

* Don't warn for typedef'd pointers, improve error message

* Fix tests

* Add TODO

* Fix test

* Set isSimplifiedTypedef() for more tokens, add test

* Add test
2022-05-24 10:09:48 +02:00
chrchr-github 22a4fdb6c4
Fix crash in checkPassByReference() () 2022-05-21 16:02:35 +02:00
chrchr-github 52f507d1fb
Fix unintentional semicolon in expression '.. ; +dostuff();' ()
* Fix  unintentional semicolon in expression '.. ; +dostuff();'

* Improve error message

* Don't remove single unary + in front of variables
2022-05-13 06:54:02 +02:00
chrchr-github 54f832a2fe
Fix FN: duplicateExpression with multiple strings compared () 2022-05-09 21:05:35 +02:00
chrchr-github aebc080c0f
Fix FN constVariable with array of pointers [regression] ()
* Fix  FN constVariable with array of pointers [regression]

* Use std::vector for deterministic order of results, use helper variables
2022-05-05 06:54:03 +02:00
chrchr-github 9a379925cd
FIx FN shadowVariable in static function ()
* FIx FN shadowVariable in static function

* Use functionOf
2022-05-04 17:56:16 +02:00
chrchr-github 1e40a2e73e
Fix C-style pointer casting not detected for casts to ** () 2022-05-03 20:15:42 +02:00
chrchr-github e7afb3045b
Fix FP redundantPointerOp with macro ()
* Fix  FN: Redundant pointer operation

* Fix FP redundantPointerOp

* Check for LValue

* Fix FP redundantPointerOp with macro

* Format
2022-04-29 13:23:50 +02:00
chrchr-github 8dbe6994a2
Fix FP redundantPointerOp ()
* Fix  FN: Redundant pointer operation

* Fix FP redundantPointerOp

* Check for LValue
2022-04-28 15:25:31 +02:00
chrchr-github 034140e7e1
Fix FN: Redundant pointer operation () 2022-04-27 19:52:56 +02:00
chrchr-github 81f9b9b2b7
Fix FP with ptr to ptr const () 2022-04-25 21:45:11 +02:00
Oliver Stöneberg 8f728cb4b6
added (partial) support for specifying C++23 and support more "-std" options () 2022-04-15 16:17:36 +02:00
chrchr-github 7721cd14b6
Fix FP constVariable with pointer typedef ()
* Fix  FP constVariable with pointer typedef

* Fix flag check

* Use isStatic()
2022-04-13 21:56:45 +02:00