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

Disallow escaping refs to implicit rvalue temporaries #75830

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jjonescz
Copy link
Member

@jjonescz jjonescz commented Nov 8, 2024

Fixes #67435.

TODO:

  • Dedicated error code.
  • Warning only in unsafe regions.
  • Breaking change doc.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 8, 2024
@jaredpar jaredpar added this to the 17.13 milestone Nov 11, 2024
@jjonescz jjonescz marked this pull request as ready for review November 12, 2024 09:51
@jjonescz jjonescz requested a review from a team as a code owner November 12, 2024 09:51
@jjonescz
Copy link
Member Author

I would like to know if the approach looks good before I continue (there are several remaining details to be implemented, see the PR description).
cc @cston @RikkiGibson

@RikkiGibson
Copy link
Contributor

Let's try to reach consensus that we want to solve this by adding an error rather than by preventing the temp from being shared. Perhaps we could talk through it in an upcoming compiler team meeting.

@jjonescz jjonescz marked this pull request as draft November 13, 2024 10:14
@jjonescz
Copy link
Member Author

Talked with Jared today; I misunderstood the discussion under the issue, we already seem to have reached a consensus to NOT report errors and instead prevent the temps from being reused by the emit layer. (The former would be too big of a break.) I will look into that.

@arunchndr arunchndr modified the milestones: 17.13, 17.13 P2 Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
4 participants