[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
Sun Jan 9 00:32:33 PST 2022


CaseyCarter created this revision.
CaseyCarter added a reviewer: libc++.
CaseyCarter added a project: libc++.
CaseyCarter requested review of this revision.
Herald added 1 blocking reviewer(s): libc++.

... even when `!defined(_LIBCPP_VERSION)`. (Note that the previous definition for this case - `((void)0);` - is ill-formed at namespace scope.)


Repository:
  rG LLVM Github Monorepo

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
@@ -237,7 +237,7 @@
 #define LIBCPP_ONLY(...) __VA_ARGS__
 #else
 #define LIBCPP_ASSERT(...) ((void)0)
-#define LIBCPP_STATIC_ASSERT(...) ((void)0)
+#define LIBCPP_STATIC_ASSERT(...) static_assert(true, "")
 #define LIBCPP_ASSERT_NOEXCEPT(...) ((void)0)
 #define LIBCPP_ASSERT_NOT_NOEXCEPT(...) ((void)0)
 #define LIBCPP_ONLY(...) ((void)0)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116880.398398.patch
Type: text/x-patch
Size: 526 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220109/14c49234/attachment.bin>


More information about the libcxx-commits mailing list