-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Everywhere: Bunch of random fixes #25997
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
base: master
Are you sure you want to change the base?
Conversation
Plus some drive-by changes, like removing redundant `Detail::` prefixes and being more studious about forwarding.
This makes my IDE happy when viewing that file
We can't really move from the NNRP as we also need to reference it in the same statement, so we pass it as a reference instead, as we are now using it only as such.
…Plan9FSMessage This is an ugly workaround, but more correct than the previous version.
otherwise we would always copy it.
@@ -55,7 +55,6 @@ class CircularQueue { | |||
VERIFY(!is_empty()); | |||
auto& slot = elements()[m_head]; | |||
T value = move(slot); | |||
slot.~T(); |
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.
This change is incorrect; the destructors of moved-from objects are run regardless according to C++ semantics (e.g. in the case of variables on the stack).
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.
well clang-sa
pointed this one out, but I see your point
not sure if I should mark this somehow (launder?), but I will drop this commit for now
construct_at<E>(&m_error, other.release_error()); | ||
construct_at<E>(&m_error, forward<ErrorOr>(other).release_error()); |
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 think other
is a forwarding reference here, as we're not in a template method. Does forward
even do anything 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.
I think in this case it's a move
?
But can make it an explicit move
in case it is really needed
Some found by trowing the clang static analyzer against the code,
The Error one is just my back log (thanks andrew)
The LibElf ones are just random.