[libcxx-commits] [libcxx] 0d91b05 - [libc++][test] cleanup in formatter.h

Casey Carter via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 11 12:57:12 PST 2023


Author: Casey Carter
Date: 2023-01-11T12:57:02-08:00
New Revision: 0d91b05052140f5ae3ebbaae36304e5d1eb2bb58

URL: https://github.com/llvm/llvm-project/commit/0d91b05052140f5ae3ebbaae36304e5d1eb2bb58
DIFF: https://github.com/llvm/llvm-project/commit/0d91b05052140f5ae3ebbaae36304e5d1eb2bb58.diff

LOG: [libc++][test] cleanup in formatter.h

* Silence warnings for unused parameters / variables
* There's no reason to output unexpected exceptions only for libc++

Differential Revision: https://reviews.llvm.org/D141453

Added: 
    

Modified: 
    libcxx/test/std/time/time.syn/formatter_tests.h

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/time/time.syn/formatter_tests.h b/libcxx/test/std/time/time.syn/formatter_tests.h
index b66b2a856abea..115d6cc7b93d8 100644
--- a/libcxx/test/std/time/time.syn/formatter_tests.h
+++ b/libcxx/test/std/time/time.syn/formatter_tests.h
@@ -70,6 +70,9 @@ void check_exception([[maybe_unused]] std::string_view what,
         std::cerr << "\nFormat string   " << fmt << "\nExpected exception " << what << "\nActual exception   "
                   << e.what() << '\n';
     assert(e.what() == what);
+#  else
+    (void)what;
+    (void)e;
 #  endif
     return;
   }
@@ -92,10 +95,9 @@ void check_invalid_type(const std::set<std::basic_string_view<CharT>>& valid_typ
           std::basic_string_view<CharT>{fmt}, std::make_format_args<format_context<CharT>>(arg));
 #ifndef TEST_HAS_NO_EXCEPTIONS
     } catch (const std::format_error& e) {
-#  if defined(_LIBCPP_VERSION)
+      (void)e;
       if constexpr (std::same_as<CharT, char>)
         std::cerr << "\nFormat string        " << fmt << "\nUnexpected exception " << e.what() << '\n';
-#  endif
       assert(false);
     }
 #endif


        


More information about the libcxx-commits mailing list