Skip to content

c_raii undefined behavior in dtor after move #176

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

Closed
kelbon opened this issue Dec 22, 2022 · 1 comment
Closed

c_raii undefined behavior in dtor after move #176

kelbon opened this issue Dec 22, 2022 · 1 comment
Assignees

Comments

@kelbon
Copy link

kelbon commented Dec 22, 2022

~c_raii() { dtor(t); }

Dctor invokes nullptr if c_raii object was moved.
Also its inefficient to store function pointer and not functional object + [[no_unqiue_address]]

@hsutter
Copy link
Owner

hsutter commented Dec 22, 2022

Good point, simplest is to make it not movable. Thanks!

@hsutter hsutter self-assigned this Dec 22, 2022
Azmah-Bad pushed a commit to Azmah-Bad/cppfront that referenced this issue Feb 24, 2023
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

2 participants