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

Rework copy ctors #630

Merged
merged 6 commits into from
Aug 10, 2024
Merged

Rework copy ctors #630

merged 6 commits into from
Aug 10, 2024

Conversation

marcauberer
Copy link
Member

  • Always generate a copy ctor if the struct contains a field of type struct that in turn has a copy ctor and/or if the struct has a heap field
  • Make default copy ctor capable of copying the underlying buffer of owning heap-allocated fields
  • Require a copy ctor for structs that are not trivially copyable
  • On assignment, first check if a copy ctor exists, if not check if it is trivially copyable. If yes, do a shallow memcopy, if no throw a compile error
  • Fix debug info on scope cleanup instructions
  • Code quality improvements

@marcauberer marcauberer added bug Something isn't working enhancement New feature or request improvement Improvement of an existing feature labels Aug 10, 2024
@marcauberer marcauberer added this to the 0.21.0 milestone Aug 10, 2024
@marcauberer marcauberer self-assigned this Aug 10, 2024
@marcauberer marcauberer requested review from a team as code owners August 10, 2024 23:11
@github-actions github-actions bot added std Prs / issues regarding the standard lib compiler labels Aug 10, 2024
@marcauberer marcauberer enabled auto-merge (squash) August 10, 2024 23:14
@marcauberer marcauberer merged commit f7955cb into main Aug 10, 2024
5 checks passed
@marcauberer marcauberer deleted the feature/copy-ctor-improvements branch August 10, 2024 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler enhancement New feature or request improvement Improvement of an existing feature size/XXL std Prs / issues regarding the standard lib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant