-
Notifications
You must be signed in to change notification settings - Fork 80
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
Bind array and function-typed compound literals to temporaries #864
Conversation
…into issue-859-address-compound-literal
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.
LGTM.
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.
Looks great.
Does it make sense to add a test case to the checkedc repo to illustrate that the probem in #856 is fixed? The Checked C repo has tests for language-level behavior, while the checkedc-clang repo has tests that may expose compiler implementation details.
See #859 - this PR will fix the issue for array-typed compound literals (but not for struct-typed compound literals - that is a follow-up issue, see issue #870)
This PR introduces a temporary binding for an array-typed or function-typed CompoundLiteralExpr. This allows the bounds checker to infer lvalue bounds for an array-typed compound literal in
CheckTempBindingLValue
.Issue #870 tracks the work needed to bind non-array, non-function-typed compound literals to temporaries (e.g. struct-typed compound literals).
Testing: