-
Notifications
You must be signed in to change notification settings - Fork 158
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 new GCC warnings #34
Conversation
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.
@mingtaoy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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 causes build failures.
fizz/record/RecordLayer.cpp
Outdated
@@ -89,10 +89,10 @@ Param parse<ServerHello>(Buf handshakeMsg, Buf original) { | |||
hrr.extensions = std::move(shlo.extensions); | |||
|
|||
hrr.originalEncoding = std::move(original); | |||
return std::move(hrr); | |||
return hrr; |
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.
You cannot elide the move here. NRVO doesn't apply since there are two branches that return different types. We need the std::move()
here to explicitly invoke the variant constructor.
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.
@neheb has updated the pull request. Re-import the pull request |
error: redundant move in return statement [-Werror=redundant-move]
@neheb has updated the pull request. Re-import the pull request |
Got rid of all the changes in fizz/record/RecordLayer.cpp . Travis seems happy. Not the case locally. I guess this is good enough. edit: I should clarify that this only fails when passing -Werror -Wall |
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.
@mingtaoy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@neheb the issue with implicit constructors that we run into in RecordLayer.cpp is discussed in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87300. Even though it's correct with the new standard, I don't think we want to simply remove the |
Well, fizz does not pass -Werror, so I think it's fine. |
Merged. Thanks for your contribution, @neheb! |
error: redundant move in return statement [-Werror=redundant-move]