GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Expand template argument type deduction by pfultz2 · Pull Request #8688 · cppcheck-opensource/cppcheck Conversation
Collaborator
Previously we only did type deduction when the argument that was passed was a literal(ie There is no varid/SymbolDatabase/ValueType information at the There is still a lot of gaps here that could be addressed in the future. Ideally, I would like to see if the logic from SymbolDatabase/ValueType could be reused here using a shared utility.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
firewave
reviewed
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer to have an entry for each file it occurs in so we would at least partially detect future regressions. Heck, we should probably move this to the source instead so we have actual individual suppressions. Since the scope has widened additional tickets probably need to be filed.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well we need to suppress it everytime we use functions like
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. It is just a debug warning (those are tracked in daca). Still a new ticket for one of the additional cases would be good for tracking.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
danmar
reviewed
|
| default: | ||
| return 0; | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
this default prevents such gcc warnings 1.cpp:6:12: warning: enumeration value ‘C’ not handled in switch [-Wswitch]
I would suggest that the default is removed. And below the switch call cppcheck::unreachable();
| default: | |
| return 0; | |
| } | |
| } | |
| cppcheck::unreachable(); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (a.isUnsigned || a.isUnsigned == b.isUnsigned) | ||
| return a; | ||
| // the lower ranked operand is unsigned, the higher ranked operand is signed | ||
| const std::size_t sizeA = arithSize(settings, a.arith); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I claim that the size does not matter. When 'long' and 'long long' have the same size:
'unsigned long' + 'signed long long' => 'signed long long'
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
If we could make the symboldatabase/ast run incrementally then we can run this in a loop, so the TemplateSimplifier can use this information and then we run the symboldatabase/ast. This is something I was working on as well, but I was looking into destroying the info everytime which makes it kind of expensive. If we could make it incremental, it might be doable. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ok |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
So in #8720, I did get it with a partially incremental update(it still rebuilds from scratches for class instantiations and template aliases). Some local tests showed it was about 2x faster with incremental updates vs rebuild everytime. I dont know if that is the direction we would prefer to go instead. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
#8720 is a much better approach for this, so I am closing this. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.