[libcxx-commits] [PATCH] D141453: [libc++][test] cleanup in formatter.h

Casey Carter via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 10 17:49:30 PST 2023


CaseyCarter created this revision.
CaseyCarter added a reviewer: Mordante.
CaseyCarter added a project: libc++.
Herald added a project: All.
CaseyCarter requested review of this revision.
Herald added a reviewer: libc++.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141453

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


Index: libcxx/test/std/time/time.syn/formatter_tests.h
===================================================================
--- libcxx/test/std/time/time.syn/formatter_tests.h
+++ libcxx/test/std/time/time.syn/formatter_tests.h
@@ -70,6 +70,9 @@
         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 @@
           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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141453.488043.patch
Type: text/x-patch
Size: 938 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230111/72eea367/attachment.bin>


More information about the libcxx-commits mailing list