Repository navigation
Add tests for #6092, #9995, #13766 - #9007
Merged
Merged
Conversation
dmcppcheck
reviewed
Nov 9, 2026
dmcppcheck
left a comment
Contributor
There was a problem hiding this comment.
AI review
This PR only adds regression tests: #6092 (array index out of bounds after a conditional i++), #9995 (unusedVariable false positive with a reference-member operator[]) and #13766 ((typename const U&) cast). I found no problems. All three new assertions pass against the PR build. Each expected message matches what the PR's cppcheck binary prints for the same code. The #6092 test also has no false positive in a variant where the index stays in bounds.
Testing
- Built
cppcheckandtestrunnerinpr/withmake -j8. The build succeeded. - Ran
./testrunner TestBufferOverrun TestOther TestUnusedVar:Tests failed: 0(682 tests, 142 todos). - Ran
pr/cppcheck --enable=allon the #6092 code, plus a variant where the array has 3 elements so the index stays in bounds:- The original code gives exactly the
[7:11] arrayIndexOutOfBoundserror that the test expects. The trace notes show the path through theif (b)branch. - The 3-element variant gives no out-of-bounds error, as expected.
- The original code gives exactly the
Automated review of dfa2a4a by Claude. The pull request was built and tested locally.
chrchr-github
merged commit Nov 9, 2026
bf89a6f
into
cppcheck-opensource:main
90 of 91 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.