[libcxx-commits] [PATCH] D110042: [libc++] counting_semaphore should not be default-constructible

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 20 13:54:09 PDT 2021


ldionne added a comment.

CI is failing because you can't use the `_v` aliases before C++14, please use `::value` instead.

I would be curious to see what the patch looks like for using `<atomic>` unconditionally under the hood. It may be reasonable to make that ABI break if we can make it ASAP - we haven't officially released it anywhere I think, but LLVM 13 would be the first release so we have to be quick (as in within a few days if it's not already too late).



================
Comment at: libcxx/test/std/thread/thread.semaphore/ctor.compile.pass.cpp:25-26
+
+static_assert(!std::is_default_constructible_v<std::binary_semaphore>, "");
+static_assert(!std::is_default_constructible_v<std::counting_semaphore<>>, "");
+
----------------
These would belong in a `ctor.default.pass.cpp` file, and we should also run the default ctor.


================
Comment at: libcxx/test/std/thread/thread.semaphore/ctor.compile.pass.cpp:32-33
+#if 0 // TODO FIXME: the ctor should be constexpr when TEST_STD_VER > 17
+constinit std::binary_semaphore bs(1);
+constinit std::counting_semaphore cs(1);
+#endif
----------------
Please follow the usual pattern of running the code in a conditionally-`constexpr` function and calling it from `main`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110042



More information about the libcxx-commits mailing list