Commit Graph

1589 Commits

Author SHA1 Message Date
Oliver Stöneberg b3016f01a1
fixed some CLion inspection warnings ()
* fixed some CLion "Unused global declaration" warnings

* fixed some CLion "Not implemented function" warnings

* fixed some CLion "Unused struct" warnings

* added TODO

* removed unused parameter reported by CLion

* fixed some CLion "Unused macro" warnings

* fixed some CLion "Condition is always true" warnings and a CLion "The value is never used" warning
2023-04-28 16:02:41 +02:00
chrchr-github 2b92351b49
Fix FP knownArgument with known return value ()
* Fix  FP knownArgument with known return value

* Add test for 
2023-04-28 08:27:48 +02:00
chrchr-github 5c7914aaa6
Fix FN constParameterReference with std::array () 2023-04-21 20:33:06 +02:00
chrchr-github e70a888833
Fix constPointer FP , TODOs ()
* Fix constPointer TODOs

* Fix  FP constParameterPointer when function signature is fixed

* Format
2023-04-18 20:36:14 +02:00
chrchr-github a0b59ff56a
Fix FN constVariableReference () 2023-04-11 14:00:40 +02:00
chrchr-github 63151f3291
Fix crash in constPointer() () 2023-04-09 16:38:09 +02:00
Oliver Stöneberg 5be8eee943
iwyu.yml: use a distro which has the latest `include-what-you-use` / enabled Qt mappings / cleaned up includes () 2023-04-08 16:08:47 +02:00
Paul Fultz II 93b4de36cd
Update constVariable IDs for references and pointers () 2023-04-07 20:14:53 +02:00
chrchr-github ab24e3a3c8
Fix remaining example from , FN , fix crash ()
* Fix remainig example from 

* Fix FP, new warnings

* More warnings

* Use getTokenArgumentFunction()

* Fix crash

* Fix  constParameter not reported with "const * const" parameter

* Fix test

* Fix new warnings

* Add suppression

* Add const, fix suppression
2023-04-06 18:46:45 +02:00
chrchr-github 86efca28a3
Fix crash in constPointer() ()
* Fix crash in constPointer()

* Format
2023-04-03 19:44:08 +02:00
chrchr-github a336048d14
Fix false negative: constParameter ()
* Partial fix for  false negative: constParameter

* Adjust test

* Update testother.cpp

* Update testother.cpp

* Fix  false negative: constParameter

* Fix new warnings

* Format

* Add difference_type

* Remove isAliased()

* Undo

* Adjust test

* Add test

* Improve const check

* Tweak constness, add tests

* Add tests

* Use new helper function, fixtest

* Remove bailout, fix check for cast

* Prevent FP

* Fix constVariable check, add tests

* Format

* Format

* Add test for 
2023-04-02 20:36:23 +02:00
chrchr-github 4d72e0f5b5
Fix FP constVariable when returning by reference () 2023-03-30 07:24:36 +02:00
chrchr-github 3836367d95
Fix FN passedByValue with array access, range-based for ()
* Fix FN passedByValue with array access, range-based for

* Format

* Fix/suppress new warnings
2023-03-30 07:24:23 +02:00
Paul Fultz II 7231d1cece
Update the isVariableChanged to correctly check the const bit () 2023-03-26 15:12:49 +02:00
Paul Fultz II d4b030694b
Move some checks for variable changed from constVariable check to isVariableChanged () 2023-03-21 18:16:40 +01:00
chrchr-github 19eef2c584
Partial fix for false negative: constParameter () 2023-03-19 17:43:23 +01:00
chrchr-github 3ccd0505cd
Enable and mitigate readability-simplify-boolean-expr () 2023-03-17 13:51:55 +01:00
Oliver Stöneberg e2f38fdaf3
removed `experimental` and `safe` from `Certainty` () 2023-03-12 14:15:29 +01:00
chrchr-github c76b05ad75
Fix FP constVariable with auto and std::map () 2023-03-09 20:01:50 +01:00
Paul Fultz II 9351eddbca
Fix 11605: FN useStlAlgo with multiple conditions () 2023-03-09 17:06:27 +01:00
Oliver Stöneberg 5af6ca6637
made `Platform` a member of `Settings` instead of inheriting from it / cleanups () 2023-03-03 18:36:27 +01:00
Oliver Stöneberg bd1ae69b00
cleaned up includes based on `include-what-you-use` () 2023-03-02 21:50:14 +01:00
chrchr-github fb88883813
Fix FP comparePointers / FN cstyleCast when taking address ()
* Fix FN cstyleCast when taking address

* Fix  FP comparePointers with member variable

* Use getParentLifetime()

* Fix test case number
2023-02-23 17:27:47 +01:00
Oliver Stöneberg afd13ea11d
ValueFlow: some interface and namespace cleanups () 2023-01-28 10:20:47 +01:00
Daniel Marjamäki 464fbe8d53 Update copyright year 2023-01-28 10:16:34 +01:00
Oliver Stöneberg bea6aec2b2
extracted `ValueFlow::Value` to `vfvalue.{cpp|h}` () 2023-01-26 22:23:22 +01:00
Oliver Stöneberg 25a6146ffa
checkother.cpp: removed stray `CheckUninitVar` object () 2023-01-18 17:10:35 +01:00
chrchr-github a2fea3d9b4
Fix FP knownConditionTrueFalse with reassigned pointer () 2023-01-18 16:57:22 +01:00
chrchr-github 7bbdc95f25
Fix FP constVariable / FP constParameter / FP danglingTempReference ()
* Fix  FP constVariable with range-based for /  FP constParameter with unused non-const range loop variable

* Fix ValueType /  FP danglingTempReference with auto

* Fix ValueType in range-based for

* Update symboldatabase.cpp
2023-01-11 22:04:06 +01:00
Oliver Stöneberg a09667a6d9
removed unused error messages () 2023-01-07 10:35:39 +01:00
Oliver Stöneberg 1cfe49e340
use `const_iterator` where possible () 2022-12-30 15:13:47 +01:00
chrchr-github 7506b4ab52
Fix FP variableScope when lambda is used () 2022-12-20 14:50:31 +01:00
Paul Fultz II 9da574f4a0
Fix 11227: ValueFlow: Known value not set in condition for ternary operator ()
* Evaluate args before function call

* Fix tests

* Format

* Add test for 11227

* Format

* Fix known condition
2022-12-18 22:07:43 +01:00
chrchr-github b1abaf8809
Fix FP useStlAlgorithm (don't suggest std::accumulate when nothing is accumulated) () 2022-12-18 16:52:04 +01:00
Oliver Stöneberg 29e0133cb5
extracted `FwdAnalysis` from `astutils.{cpp|h}` ()
* added missing filtering offiles in Visual Studio project

* extracted `FwdAnalysis` from `astutils.{cpp|h}`
2022-12-13 22:29:23 +01:00
chrchr-github 3f5054035d
Fix FP passedByValue for overriden function () 2022-12-12 21:52:58 +01:00
chrchr-github d5d7446433
Add cfg for std::scoped_lock, handle template arguments in checkMisusedScopedObject() () 2022-12-07 09:10:48 +01:00
gerboengels 3fdba645a6
Improve fix for FP selfAssignment: lambda capture () 2022-11-18 19:44:32 +01:00
chrchr-github 701d381895
Fix FP selfAssignment: lambda capture / FP operatorEqRetRefThis ()
* Fix   FP selfAssignment: lambda capture /  
FP operatorEqRetRefThis

* Format
2022-11-13 21:20:44 +01:00
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