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.
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
C++: Generate IR for destruction of unconditionally constructed temporaries #16125
C++: Generate IR for destruction of unconditionally constructed temporaries #16125
Changes from 36 commits
75c453f
894d934
17e8c95
cf996f8
d4e2d37
a756f14
56a132f
796fcfe
a6a0e20
73602dc
0b7070f
774efb5
805b4d6
1808886
8f11cb6
587ae07
f098b8e
b6ddb97
e63a607
d279e3f
bb2c690
b042366
f1d2dac
4c01c06
955f9c7
54e4103
45e7154
a0de95d
89eaadd
fcd0e99
8a6a60e
d40fa4c
febd060
9c25ce4
4fa53b6
17c8fa3
c325a79
7172e2f
736d59c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Why is this case not detected? The function signature and implementation is identical to
ref_to_first_in_returnValue_1
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.
I haven't investigated why yet. Note that, while function signature and implementation is identical to
ref_to_first_in_returnValue_1
, they differ in how they're used. See here for this. Specifically:In the one we detect (i.e.,
ref_to_first_in_returnValue_1
) the range-based for loop looks like:and in the one we fail to detect the range-based for loop looks like:
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.
We could improve the UX on this by moving the alert location to the for-loop (instead of at the place where the temporary is destructed). The problem with this is that the elements in the DB for range-based for loops don't always have a location (which makes for an even worse UX 😂)