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

Optional assignment operator may access uninitialized storage value #832

Closed
Chiraffollo opened this issue Jan 26, 2024 · 0 comments
Closed

Comments

@Chiraffollo
Copy link
Contributor

If an empty optional is move assigned to an optional, the move assignment operator accesses the not initialized storage.value.
This leads to a compile error on GCC. As an failing example is not easy to show in this description, I've created one using compiler explorer, see https://godbolt.org/z/jjTzz9bxo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant