[libcxx-commits] [libcxx] 7291761 - [libc++] Fixes charconv operator bool tests. (#80598)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Feb 9 08:30:33 PST 2024


Author: Mark de Wever
Date: 2024-02-09T17:30:30+01:00
New Revision: 7291761669dd63624ccaab30887aca7e9c7d3273

URL: https://github.com/llvm/llvm-project/commit/7291761669dd63624ccaab30887aca7e9c7d3273
DIFF: https://github.com/llvm/llvm-project/commit/7291761669dd63624ccaab30887aca7e9c7d3273.diff

LOG: [libc++] Fixes charconv operator bool tests. (#80598)

This was spotted by @philnik.

Added: 
    

Modified: 
    libcxx/test/std/utilities/charconv/charconv.syn/from_chars_result.operator_bool.pass.cpp
    libcxx/test/std/utilities/charconv/charconv.syn/to_chars_result.operator_bool.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/utilities/charconv/charconv.syn/from_chars_result.operator_bool.pass.cpp b/libcxx/test/std/utilities/charconv/charconv.syn/from_chars_result.operator_bool.pass.cpp
index b628a2c76acf50..a6aa590ee944fd 100644
--- a/libcxx/test/std/utilities/charconv/charconv.syn/from_chars_result.operator_bool.pass.cpp
+++ b/libcxx/test/std/utilities/charconv/charconv.syn/from_chars_result.operator_bool.pass.cpp
@@ -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;

diff  --git a/libcxx/test/std/utilities/charconv/charconv.syn/to_chars_result.operator_bool.pass.cpp b/libcxx/test/std/utilities/charconv/charconv.syn/to_chars_result.operator_bool.pass.cpp
index ef9364d3a64709..621eb8a493fd37 100644
--- a/libcxx/test/std/utilities/charconv/charconv.syn/to_chars_result.operator_bool.pass.cpp
+++ b/libcxx/test/std/utilities/charconv/charconv.syn/to_chars_result.operator_bool.pass.cpp
@@ -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;


        


More information about the libcxx-commits mailing list