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
Issue 7516 - Postblit not called for structs returned from a ternary operator #4805
Conversation
Rebased on master, and ready for ddmd. |
af9e000
to
3e25095
Compare
|
3231796
to
040e3c4
Compare
Looks OK. Though DoCopyOrMove doesn't roll off the tongue so well. :-) Looks like there are failing tests too, though haven't checked why. |
There was a small merge conflict. Fixed. |
@@ -1564,10 +1585,11 @@ extern (C++) bool functionParameters(Loc loc, Scope* sc, TypeFunction tf, Type t | |||
} | |||
else | |||
{ | |||
// arg = arg->isLvalue() ? callCpCtor(sc, arg) : valueNoDtor(arg); | |||
//arg = doCopyOrMove(sc, arg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's going on here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bad indent in comment had been introduced by ddmd conversion. Originally the the comment start //
was at 0 column in C++ code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be fair, the comment should not have been starting at column zero, so it was already badly indented before ddmd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mean the indent. Why is there a piece of commented-out code without explanation in an otherwise-empty else branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can see from the git history, when Walter had added imrovements for throwing exceptions during function arguments evaluation, this line was commented out. So today, it's surely a dead code and IMO it won't be enabled again.
I've just removed the empty else branch.
Auto-merge toggled on |
Thanks! |
Issue 7516 - Postblit not called for structs returned from a ternary operator
https://issues.dlang.org/show_bug.cgi?id=7516
Today, front-end layer handles most of postblit calls, so it's easily fixable.