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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix error_category
regression with Boost.System
#3176
Merged
StephanTLavavej
merged 2 commits into
microsoft:main
from
StephanTLavavej:fix-boost-system
Oct 26, 2022
Merged
Fix error_category
regression with Boost.System
#3176
StephanTLavavej
merged 2 commits into
microsoft:main
from
StephanTLavavej:fix-boost-system
Oct 26, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CaseyCarter
requested changes
Oct 25, 2022
strega-nil-ms
approved these changes
Oct 25, 2022
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.
reluctantly approved 馃樋
CaseyCarter
approved these changes
Oct 25, 2022
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
frederick-vs-ja
approved these changes
Oct 26, 2022
@StephanTLavavej Thank you very much for this fix |
Should have alerted me about it. :-) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Followup to #3139.
Bad kitties jump up on the table where they're not allowed. 馃樇 Boost.System was a very bad kitty:
https://github.com/boostorg/system/blob/9a6d79b84147854aa919644b56b8553f5a2bedb8/include/boost/system/detail/std_category.hpp#L46-L52
When #3139 fixed
error_category
's default constructor to beconstexpr
, it had to change_Addr
into aunion
, breaking this highly non-Standard code in Boost.System. This resulted in widespread breakage in our test team's "Real World Code" suites.Because Boost is a widely used third-party library, even if we reported this upstream and they were somehow able to avoid doing this, or simply changed their non-Standard code to detect our new
error_category
and use different non-Standard code, projects throughout the C++ ecosystem would be broken until they updated Boost.Adjusting the STL's code to continue permitting this non-Standard usage is the least undesirable option here (compared to reverting #3139, refusing to yield, adding an escape hatch, etc.). Notes for these changes:
public
operator=
to_Addr_storage
, but it and_Addr
are stillprotected
, so this is not observable to Standard code.constexpr
to be "transparent", even though Boost doesn't need this.uintptr_t
also to be transparent, because that's what we store.noexcept
to avoid emitting EH enforcement.While RWC test coverage would be sufficient, I'm adding a bit of test code in order to more quickly detect any maintenance changes that would break this workaround. The test takes
unsigned int
because that's what Boost is using.(To be clear, I love Boost and I've used it for 20 years, but accessing internal data members is problematic for precisely this reason! 馃樄)