[libcxx-commits] [PATCH] D116880: [libcxx][test] Make LIBCPP_STATIC_ASSERT usable at namespace scope

Casey Carter via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 10 16:35:43 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG1d3964d2adc4: [libcxx][test] Make LIBCPP_STATIC_ASSERT usable at namespace scope (authored by CaseyCarter).

Changed prior to commit:
  https://reviews.llvm.org/D116880?vs=398398&id=398777#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116880/new/

https://reviews.llvm.org/D116880

Files:
  libcxx/test/support/test_macros.h


Index: libcxx/test/support/test_macros.h
===================================================================
--- libcxx/test/support/test_macros.h
+++ libcxx/test/support/test_macros.h
@@ -236,11 +236,11 @@
 #define LIBCPP_ASSERT_NOT_NOEXCEPT(...) ASSERT_NOT_NOEXCEPT(__VA_ARGS__)
 #define LIBCPP_ONLY(...) __VA_ARGS__
 #else
-#define LIBCPP_ASSERT(...) ((void)0)
-#define LIBCPP_STATIC_ASSERT(...) ((void)0)
-#define LIBCPP_ASSERT_NOEXCEPT(...) ((void)0)
-#define LIBCPP_ASSERT_NOT_NOEXCEPT(...) ((void)0)
-#define LIBCPP_ONLY(...) ((void)0)
+#define LIBCPP_ASSERT(...) static_assert(true, "")
+#define LIBCPP_STATIC_ASSERT(...) static_assert(true, "")
+#define LIBCPP_ASSERT_NOEXCEPT(...) static_assert(true, "")
+#define LIBCPP_ASSERT_NOT_NOEXCEPT(...) static_assert(true, "")
+#define LIBCPP_ONLY(...) static_assert(true, "")
 #endif
 
 #if !defined(_LIBCPP_HAS_NO_RANGES)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116880.398777.patch
Type: text/x-patch
Size: 877 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220111/c493ce4c/attachment.bin>


More information about the libcxx-commits mailing list