-
Notifications
You must be signed in to change notification settings - Fork 59
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
Consider additional use-cases to conclude a function as "used" #347
Conversation
@lcartey : Kindly help review this PR. |
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.
Thanks @rak3-sh! I've made a few suggestions to the query itself, to improve robustness and possibly remove some redundant cases.
@rak3-sh also needs clang-format. |
Co-authored-by: Luke Cartey <5377966+lcartey@users.noreply.github.com>
@lcartey : Thanks a lot for your valuable inputs. I've reworked based on your suggestions. Kindly let me know in case of any further questions. |
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.
Thanks @rak3-sh. Sorry for the delay reviewing - this one turned out to be more complex than I was expecting, with respect to the way overload sets are identified in C++. I have made some pragmatic suggestions in the comments to get this PR merged, and I think we can then refine the logic further in follow up PRs.
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.
A couple of documentation tweaks, but otherwise looks good, thanks!
Co-authored-by: Luke Cartey <5377966+lcartey@users.noreply.github.com>
Description
This PR fixes issue 121. It modifies the A0-1-3 query to consider functions as used for the following use-cases.
The address of a function is taken
The operand of an expression in an unevaluated context
Functions marked with [[maybe_unused]]
Explicitly deleted functions e.g. =delete
Use of any overload of a function in an overload set constitute a use of all members of the set. An overload set is a set of functions with the same name that differ in the number, type and/or qualifiers of their parameters.
Change request type
.ql
,.qll
,.qls
or unit tests)Rules with added or modified queries
Release change checklist
A change note (development_handbook.md#change-notes) is required for any pull request which modifies:
If you are only adding new rule queries, a change note is not required.
Author: Is a change note required?
🚨🚨🚨
Reviewer: Confirm that format of shared queries (not the .qll file, the
.ql file that imports it) is valid by running them within VS Code.
Reviewer: Confirm that either a change note is not required or the change note is required and has been added.
Query development review checklist
For PRs that add new queries or modify existing queries, the following checklist should be completed by both the author and reviewer:
Author
As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.
Reviewer
As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.