Skip to content
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++: Output destructors of temporary objects #15770

Closed
wants to merge 1 commit into from

Conversation

jketema
Copy link
Contributor

@jketema jketema commented Feb 29, 2024

No description provided.

@github-actions github-actions bot added the C++ label Feb 29, 2024
@rdmarsh2
Copy link
Contributor

I'd expect to see a destructor call for the temporary string at line 1369 of ir.cpp. The AST otherwise looks good to me.

@jketema
Copy link
Contributor Author

jketema commented Mar 1, 2024

I'd expect to see a destructor call for the temporary string at line 1369 of ir.cpp.

This turns out to be a very interesting case. It's a temporary, by the lifetime is at block scope, not expression scope.

@jketema jketema force-pushed the destructors-temp branch from b03140d to c07c457 Compare March 1, 2024 15:34
@jketema
Copy link
Contributor Author

jketema commented Mar 4, 2024

very interesting case. It's a temporary, by the lifetime is at block scope, not expression scope.

This is now fixed.

@jketema jketema force-pushed the destructors-temp branch 3 times, most recently from 3071727 to 4e279af Compare March 8, 2024 14:50
@jketema
Copy link
Contributor Author

jketema commented Mar 14, 2024

This PR is now just test updates. All the other parts have been merged into main in separate PRs.

@jketema
Copy link
Contributor Author

jketema commented Mar 20, 2024

Closing in favour of #15978. That's the 3rd in a series of PRs, which mostly does what was done here, except for some synthetic destructor generation related to throws (that'll be a separate PR).

@jketema jketema closed this Mar 20, 2024
@jketema jketema deleted the destructors-temp branch March 20, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants