Conversation
- There's some code that appears to be unnecessary in VisitVarDecl. We should remove it. VisitCastExpr should already be taking care of this. - In addition, describe the difference between the Visit* and Traverse* methods. It's not immediately obvious whhat the difference is. - Rename TraverseVarDecl to TraverseTopLevelVarDecl for clarity.
sxl463
approved these changes
Jun 12, 2018
| if (!D->isLocalVarDeclOrParm()) | ||
| CheckBoundsDeclarations(*this, nullptr).TraverseVarDecl(D, getCurScope()->isCheckedScope()); | ||
| if (!D->isLocalVarDeclOrParm()) { | ||
| auto Checker = CheckBoundsDeclarations(*this, nullptr); |
Contributor
There was a problem hiding this comment.
Do we need to update the existed code right after this change? Just like this snippet:
void Sema::CheckTopLevelBoundsDecls(VarDecl *D) {
if (!D->isLocalVarDeclOrParm())
CheckBoundsDeclarations(*this, nullptr).TraverseVarDecl(D, getCurScope()->isCheckedScope());
}
Member
Author
|
Thanks for the CR - I removed the use of auto and just used an initializer instead. |
sulekhark
pushed a commit
that referenced
this pull request
Jul 8, 2021
The code for deciding if a function should get an itype was duplicated for function declarations and function pointer types. The function pointer version of the code had a bug in it that caused issue #498. The duplicated code has been extracted into a pair of functions that are reused for functions and function pointers. A lot of the lines changed in this PR are caused by an EnvironmentMap& parameter being changed to Constraints&. This lets the function pointer code call solutionEqualTo which is needed for correct itype insertion.
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.
Testing: