Skip to content
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
merged 2 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions stl/inc/system_error
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ protected:
public:
constexpr explicit _Addr_storage(const uintptr_t _Addr_num) noexcept : _Num(_Addr_num) {}
constexpr explicit _Addr_storage(error_category* const _Addr_ptr) noexcept : _Ptr(_Addr_ptr) {}

// TRANSITION: As of Boost 1.80.0, boost::system::detail::std_category assigns to _Addr.
constexpr _Addr_storage& operator=(const uintptr_t _Addr_num) noexcept {
_Num = _Addr_num;
return *this;
}
};
static_assert(sizeof(_Addr_storage) == sizeof(uintptr_t) && alignof(_Addr_storage) == alignof(uintptr_t),
"Unsupported platform");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ struct meow_category : error_category {
string message(int) const override {
return "meow";
}

// TRANSITION: As of Boost 1.80.0, boost::system::detail::std_category assigns to _Addr.
void test_workaround_for_non_standard_code(const unsigned int val) noexcept {
_Addr = val;
}
};

#if _HAS_CXX20
Expand Down