Skip to content

Commit

Permalink
[libc++] Fixes charconv operator bool tests. (#80598)
Browse files Browse the repository at this point in the history
This was spotted by @philnik.
  • Loading branch information
mordante committed Feb 9, 2024
1 parent a5cc1dc commit 7291761
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -28,13 +28,13 @@ constexpr bool test() {
{
std::from_chars_result value{nullptr, std::errc{}};
assert(bool(value) == true);
static_assert(noexcept(bool(true)) == true);
static_assert(noexcept(bool(value)) == true);
}
// False
{
std::from_chars_result value{nullptr, std::errc::value_too_large};
assert(bool(value) == false);
static_assert(noexcept(bool(true)) == true);
static_assert(noexcept(bool(value)) == true);
}

return true;
Expand Down
Expand Up @@ -28,13 +28,13 @@ constexpr bool test() {
{
std::to_chars_result value{nullptr, std::errc{}};
assert(bool(value) == true);
static_assert(noexcept(bool(true)) == true);
static_assert(noexcept(bool(value)) == true);
}
// False
{
std::to_chars_result value{nullptr, std::errc::value_too_large};
assert(bool(value) == false);
static_assert(noexcept(bool(true)) == true);
static_assert(noexcept(bool(value)) == true);
}

return true;
Expand Down

0 comments on commit 7291761

Please sign in to comment.