[libcxx-commits] [PATCH] D89866: [libcxx] [test] Mark bits of fs.enum tests as libcpp specific

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 21 03:49:13 PDT 2020


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

The individual enum values in copy_options and file_type aren't specified in the standard.

The standard doesn't require fs::path::format to be a scoped enum.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89866

Files:
  libcxx/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.enum/enum.file_type.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp


Index: libcxx/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp
===================================================================
--- libcxx/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp
+++ libcxx/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp
@@ -25,7 +25,7 @@
 
   // Check that E is a scoped enum by checking for conversions.
   typedef std::underlying_type<E>::type UT;
-  static_assert(!std::is_convertible<E, UT>::value, "");
+  LIBCPP_ONLY(static_assert(!std::is_convertible<E, UT>::value, ""));
 
   LIBCPP_ONLY(static_assert(std::is_same<UT, unsigned char>::value, "")); // Implementation detail
 
Index: libcxx/test/std/input.output/filesystems/fs.enum/enum.file_type.pass.cpp
===================================================================
--- libcxx/test/std/input.output/filesystems/fs.enum/enum.file_type.pass.cpp
+++ libcxx/test/std/input.output/filesystems/fs.enum/enum.file_type.pass.cpp
@@ -31,7 +31,7 @@
 
   LIBCPP_ONLY(static_assert(std::is_same<UT, signed char>::value, "")); // Implementation detail
 
-  static_assert(
+  LIBCPP_ONLY(static_assert(
           E::none == ME(0) &&
           E::not_found == ME(-1) &&
           E::regular == ME(1) &&
@@ -42,7 +42,7 @@
           E::fifo == ME(6) &&
           E::socket == ME(7) &&
           E::unknown == ME(8),
-        "Expected enumeration values do not match");
+        "Expected enumeration values do not match"));
 
   return 0;
 }
Index: libcxx/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp
===================================================================
--- libcxx/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp
+++ libcxx/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp
@@ -35,6 +35,7 @@
   typedef check_bitmask_type<E, E::skip_existing, E::update_existing> BitmaskTester;
   assert(BitmaskTester::check());
 
+#ifdef _LIBCPP_VERSION
   static_assert(
           E::none == ME(0),
         "Expected enumeration values do not match");
@@ -59,6 +60,7 @@
           E::create_symlinks     == ME(128) &&
           E::create_hard_links   == ME(256),
         "Expected enumeration values do not match");
+#endif
 
   return 0;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89866.299633.patch
Type: text/x-patch
Size: 2253 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201021/0d2a02b1/attachment.bin>


More information about the libcxx-commits mailing list