-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Cut noexcept calculations in dynamic-inl.h #1034
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.
Must also do .cpp
.
9b8d066
to
3475baa
Compare
Thanks, just fixed the corresponding |
There was a reason which appears no longer to be relevant. This was to outline these functions to shrink the code size of We are now using So there should be no problem with declaring all of these as defaulted within the class body, which would automatically take care of finding the proper |
3475baa
to
54f7296
Compare
Thanks for the explanation -- makes sense. I went ahead and just defaulted them in |
Summary: - GCC 4.9 previously required marking `TypeError` special member functions with conditional noexcept. - GCC 5.1 does not have this issue, so defaulting them is sufficient. In fact, we can even let the compiler automatically generate these special member functions.
54f7296
to
9698eef
Compare
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.
@yfeldblum has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
I am internally rewriting the commit message on this one before landing to reflect that this is now about de-outlining the special member functions. |
Nice reword of the commit. Thanks for that and helping it land! |
Summary: The `TypeError` special member functions - copy and move constructors and assignment operators - were outlined to reduce inline code size of `throw TypeError(...);` statements. This is no longer necessary, since these sites have been replaced by `folly::throw_exception<TypeError>(...);` statements, which have minimal inline code size. As a benefit, the special member functions may all now be declared as defaulted within the class body, and the conditional `noexcept` calculations are no longer required to be written - the compiler will do them. (Note: as of the libstdc++ which ships with GCC 5, library exception special member functions are `noexcept`; previously, they are not.) Pull Request resolved: facebook#1034 Reviewed By: nbronson Differential Revision: D14255166 Pulled By: yfeldblum fbshipit-source-id: 2f795a2b937fee58f243a9d374fc01829c674fe6
Summary:
TypeError
special memberfunctions with conditional noexcept.
as they always evalaute to true in the existing code.