Commit Graph

433 Commits

Author SHA1 Message Date
Oliver Stöneberg 2935c855c3
reduced usage of mutable `Settings` objects in tests () 2023-05-02 11:48:24 +02:00
Paul Fultz II 6820b70dd1
Fix 11636: FP nullPointer with uninstantiated template ()
* Fix 11636: FP nullPointer with uninstantiated template

* Format
2023-04-23 14:40:03 +02:00
chrchr-github 6e5375f7b7
Add tests for , , ()
* Add tests for , , 

* Format

* Add tests for # 6561, , ,

* Add tests for , , 
2023-04-21 16:09:52 +02:00
Oliver Stöneberg 03214c6c08
testnullpointer.cpp: restored TODO assert in `nullpointerStdStream` () 2023-03-26 16:18:44 +02:00
Oliver Stöneberg f002429a6b
testrunner: fail if `TODO_ASSERT_*` succeeds ()
* testrunner: fail if TODO succeeds

* testnullpointer.cpp: removed TODO from assert in `nullpointerStdStream`
2023-03-26 15:13:07 +02:00
orbitcowboy 38f9c81dd2 Added regression test to : FN nullptr 2023-03-24 20:29:33 +01:00
chrchr-github 96887c8130
Fix FN nullPointer with unnamed parameter () 2023-02-23 22:56:03 +01:00
chrchr-github d06f93aebf
Fix nullPointer false positive () 2023-02-06 22:06:04 +01:00
Oliver Stöneberg 7c7ccdf7c0
Check: disallow more than one instance per check () 2023-01-29 17:23:03 +01:00
Daniel Marjamäki 464fbe8d53 Update copyright year 2023-01-28 10:16:34 +01:00
Oliver Stöneberg 1d3955bd92
renamed some files in the `test` folder () 2023-01-27 08:18:32 +01:00
chrchr-github 3076f9def1
Fix Function call not recognized with extra parentheses / FP nullPointer () 2023-01-18 20:38:37 +01:00
chrchr-github 7515305581
Add test for () 2023-01-18 17:30:22 +01:00
chrchr-github 4c8aa56d8b
Partial fix for internalAstError regressions (iscpp11init) ()
* Partial fix for  internalAstError regressions (iscpp11init)

* Use %cop%

* Add test for 

* Format

* Format
2022-12-16 10:46:15 +01:00
Paul Fultz II 663a8411dd
Fix 11416: FP nullPointerRedundantCheck for check after loop with break () 2022-12-08 07:27:06 +01:00
Rikard Falkeborn 52264b9c26
Fix nullpointer dereference with alignof ()
* checknullpointer: Don't report dereference with alignof

* Refactor unevaluating operator check in checknullpointer

Unifying these ensures the different checks treat the operators the
same.

* Fix FP with _Alignof and null pointer

Just like alignof, _Alignof does not evaluate its operand.

* CheckNullPointer: Also support compiler specific alignof

This fixes  which is about __alignof__. For good measure, also add
the microsoft extensions __alignof and _alignof.
2022-11-27 09:20:19 +01:00
chrchr-github 45ccc9ba1e
Fix ctunullpointer FP () 2022-09-16 12:11:34 +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
Oliver Stöneberg 1b4141cbe5
added more missing `sstream` includes () 2022-08-19 18:23:15 +02:00
Paul Fultz II c0f55a2b85
Fix 11142: FP nullPointer before assignment ()
* Fix 11142: FP nullPointer before assignment

* Format

* Use simpleMatch
2022-08-03 19:05:07 +02:00
chrchr-github 71f9a7269f
Add test for , , avoid duplicate warning ()
* Add test for , avoid duplicate warning

* Add test for 

* Fix test
2022-08-02 21:43:18 +02:00
chrchr-github 111f4e17da
Fix FP nullPointerArithmetic when adding 0 () 2022-06-03 13:11:54 +02:00
chrchr-github 112b1573c5
Fix FN constructing string from nullptr / FN unread variables ()
* Fix  FN constructing string from nullptr /  FN unread variables

* Format
2022-05-18 13:52:44 +02:00
Paul Fultz II 843f7893d6
Fix 11040: FP nullPointer after loop () 2022-05-05 06:55:02 +02:00
chrchr-github 0dc3cb6eba
Fix FP nullPointerRedundantCheck with static function pointer () 2022-04-26 17:25:56 +02:00
orbitcowboy aa7a1f25c1 Added regression test from Ticket #3929:comment18 2022-04-10 08:10:11 +02:00
Paul Fultz II 74667d1e2a
Fix 10418: false negative: knownConditionTrueFalse ()
* Improve handling inverted condition

* Fix tests

* Rename variables for clarity

* Add initial test

* Add another test

* Format

* Fix FP
2022-04-07 06:48:13 +02:00
chrchr-github ddb0a8bb0b
Fix missing varId with using namespace ()
* Fix  missing varId with using namespace

* Undo

* Fix test

* Limit namespace candidates, duplicateBranch

* rvalue ref

* Undo

* Undo

* Undo

* Format

* Fix condition
2022-02-27 09:03:24 +01:00
Paul Fultz II dbc80787e1
Fix 10821: FN: containerOutOfBounds ()
* Fix 10821: FN: containerOutOfBounds

* Format

* Fix cppcheck warning

* Add valueflow tests

* Format

* Fix some bugs

* Format
2022-02-25 05:53:51 +01:00
Oliver Stöneberg f32583e097
removed OVERRIDE and FINAL defines and use the keywords directly () 2022-02-10 23:02:24 +01:00
Daniel Marjamäki 3989408738 Update copyright year 2022-02-05 11:45:17 +01:00
chrchr-github dad64bfcc8
Fix FP shadowFunction with default destructor implementation / Tests for , , , , () 2022-02-02 19:30:49 +01:00
chrchr-github 69ee464dff
Fix test for () 2022-02-02 19:29:01 +01:00
Oliver Stöneberg 171da2e6f9
avoid dependency on transitive includes - based on include-what-you-use () 2022-01-27 19:03:20 +01:00
Paul Fultz II 9220c8175d
Remove todo assert () 2022-01-16 12:32:46 +01:00
Paul Fultz II 1682344a80
Fix 10678: FP nullPointerArithmeticRedundantCheck in while loop () 2022-01-04 21:19:45 +01:00
chrchr-github e6091cbe54
Add tests for , , , () 2021-12-20 13:12:19 +01:00
Paul Fultz II 5414814238
Fix 10649: False positive: wrong known value after reassignment () 2021-12-15 19:37:25 +01:00
orbitcowboy bca27bf7d2 Ticket , added regression test 2021-12-07 08:50:29 +01:00
Paul Fultz II 0be6e27231
Fix 10640: FN nullPointerRedundantCheck ()
* Fix 10640: FN nullPointerRedundantCheck

* Format
2021-12-06 20:06:48 +01:00
chrchr-github b6b2cf8283
Add tests, todo for , () 2021-12-02 17:28:31 +01:00
chrchr-github b4a60305f9
Add todo for () 2021-11-29 19:12:07 +01:00
chrchr-github ca311ebcdf
ASSERT() on calls to Tokenizer::tokenize() in test code () 2021-11-29 07:34:39 +01:00
Paul Fultz II 57f5b19b34
Fix 7812: False negative: return pointer of local variable ()
* Fix 7812: False negative: return pointer of local variable

* Format

* Add test case for 3029

* Format
2021-11-28 15:25:21 +01:00
Paul Fultz II 12e731ad49
Fix 10605: FP containerOutOfBounds with empty() check () 2021-11-25 22:34:00 +01:00
Paul Fultz II 130d1abbce
Fix 10210: FN: nullPointerRedundantCheck regression in member function () 2021-10-15 10:57:40 +02:00
Paul Fultz II 3cb252bd99
Fix 9873: False negative: null pointer when checking raw pointer () 2021-10-06 08:39:58 +02:00
Paul Fultz II 9b6c7007d2
Fix 9870: False negative: null pointer after duplicate conditions () 2021-10-05 08:29:23 +02:00
Paul Fultz II 255dc0484a
Fix 10331: wrong conditional value after assignment+return () 2021-09-21 19:25:41 +02:00
chrchr-github 05acc13582
Shadow variables, const, rename function () 2021-09-15 20:28:58 +02:00