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

Fix #3778 - in-place construct <temporary>.ctor(args) #3779

Merged
merged 2 commits into from
Jul 14, 2021

Conversation

kinke
Copy link
Member

@kinke kinke commented Jul 5, 2021

No description provided.

// vector literals too
if (auto ve = rhs->isVectorExp()) {
// and vector literals
else if (auto ve = rhs->isVectorExp()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there is not a guaranteed return statement in the previous else-if (line 2852), this is slight change in behavior. Was that intentional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the elses are intentional - no point in continuing the checks for other types of expressions if we know it was another one and couldn't be in-place constructed.


I might go with a recursive approach for the ctor case; I thought that was infeasible because I thought lhs was an Expression too, but it's a DValue.

@kinke kinke enabled auto-merge (squash) July 14, 2021 16:00
@kinke kinke merged commit c6bce7e into ldc-developers:master Jul 14, 2021
@kinke kinke deleted the rvo branch July 14, 2021 16:35
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

Successfully merging this pull request may close these issues.

2 participants