Repository navigation
Fix 13630, 9676: Template argument deduction using SymbolDatabase #8720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pfultz2
wants to merge
62
commits into
cppcheck-opensource:main
Choose a base branch
from
pfultz2:template-deduce-loop
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,926
−294
Open
Changes from all commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
247fa8f
Deduce templates using a symboldatabase loop
0e15903
Make symboldatabase incremental
714e49d
Use settings flag
753563f
Incremental AST and ValueType
93e947d
Add some todo tests
0ce48a0
Refactor the functions
865f0aa
Simplify
5b3bdbb
Make a private static function
101146d
Remove some flags
7953636
Fix default statements
c6c1948
Set default values
2479ea6
Tweak the cli tests
3ea439c
Bump the other expected results
1aa06fc
Fix the results
0d8e8cc
Fix CI issues
6ee101e
Add unit tests
a26a03f
Fix ubsan error
fd68885
Fix selfcheck
d14c231
Increase timeout
24ffd62
Remove static_cast
def6944
Some cleanup
b2b88f4
Format
979097b
Add assert
d863b06
Fix cppcheck premuim warnings
990052b
Reduce copies of the tokenlist
5b8def6
Use stl algorithms
pfultz2 acac729
Format
pfultz2 e72577e
Merge branch 'main' into template-deduce-loop
pfultz2 8016585
Add test for 13630
pfultz2 771eb64
Fixes from feedback
pfultz2 0afea93
Merge
pfultz2 4f40e4f
Merge
pfultz2 2733865
Fix the FP introduced in this PR
pfultz2 c214761
Fix CI failures
pfultz2 82c5abe
merge
pfultz2 d85b405
Make the flag sticky
pfultz2 8124374
Handle enums
pfultz2 f2e794e
Support arrays
pfultz2 f0f7516
Handle const pointers
pfultz2 2d33a2b
Cleanup
pfultz2 73fd65a
merge
pfultz2 7ef5b93
Handle nested type deductions
pfultz2 71c2a23
Check namespace first
pfultz2 127f7a1
Handle shadowing
pfultz2 afef2a3
Rerun
pfultz2 06e5836
Use find_if
pfultz2 9283a76
Fix recursive deduction
pfultz2 255e8a3
Fix this instantiation
pfultz2 f72486f
Cleanup
pfultz2 8fc5ddb
Handle signed/unsigned
pfultz2 776ffea
Use pointer for DeductionCache
pfultz2 6cbe798
Fix cppcheck warnings
pfultz2 bc64680
Remove static cast
pfultz2 cf53504
Dont instantiate a template type
pfultz2 b217a3e
Fix the name
pfultz2 eecfc81
Merge
pfultz2 fd805f7
Parse function pointers in valuetype
pfultz2 aa96408
Propagate the bits
pfultz2 b130b46
Add release notes
pfultz2 f079e21
Merge
pfultz2 e521191
Merge
pfultz2 436735e
Fix issue with functions pointers
pfultz2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AI review
This bail-out also applies when the variable is declared as a pointer to the template parameter (
T* p). That variable is a pointer for everyT, sop >= 0is pointless in generic code too. Base reportspointerPositivefor this code, the PR reports nothing, even for an explicit call:Consider bailing out only when the pointer or unsigned property comes from
Titself, for example by skipping the bail-out whenvar->isPointer()(the declaration has its own*).