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

Use value-initialization in C++ to gracefully handle non-POD types #9603

Closed
wants to merge 3 commits into from
Closed

Use value-initialization in C++ to gracefully handle non-POD types #9603

wants to merge 3 commits into from

Conversation

jwollen
Copy link
Contributor

@jwollen jwollen commented Nov 2, 2018

Locals of types containing imported non-POD members currently get zeroed, leaving them in an invalid state. This replaces zeroing with value-initialization when in C++ mode.

@sinkingsugar
Copy link
Contributor

Completely necessary for any serious interaction with c++ code like we are doing with NimTorch.

@sinkingsugar
Copy link
Contributor

Nice, lately CI seems to be working nicely as intended! Nice catches.

@mratsim
Copy link
Collaborator

mratsim commented Nov 3, 2018

This would probably be necessary to support C++ destructors in seq status-im/nim-ttmath#10

Otherwise Clang (but not GCC) complains about:
error: flexible array member 'data' of type 'Foo []' with non-trivial destruction

@jwollen
Copy link
Contributor Author

jwollen commented Nov 3, 2018

@mratsim I'll have a look at sequences/refs afterwards, but they might be more painful since much of them is implemented in the stdlib and not generic :/

@stale
Copy link

stale bot commented Mar 3, 2021

This pull request has been automatically marked as stale because it has not had recent activity. If you think it is still a valid PR, please rebase it on the latest devel; otherwise it will be closed. Thank you for your contributions.

@stale stale bot added the stale Staled PR/issues; remove the label after fixing them label Mar 3, 2021
@timotheecour
Copy link
Member

I think cppNonPod from #16750 is very related to this

@stale stale bot removed the stale Staled PR/issues; remove the label after fixing them label Mar 9, 2021
@stale
Copy link

stale bot commented Mar 10, 2022

This pull request has been automatically marked as stale because it has not had recent activity. If you think it is still a valid PR, please rebase it on the latest devel; otherwise it will be closed. Thank you for your contributions.

@stale stale bot added the stale Staled PR/issues; remove the label after fixing them label Mar 10, 2022
@stale stale bot closed this Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ Code Generation Severe stale Staled PR/issues; remove the label after fixing them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants