[libcxx-commits] [PATCH] D125634: [libc++] Use _LIBCPP_ASSERT by default for _PSTL_ASSERTions

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 18 12:44:43 PDT 2022


ldionne accepted this revision.
ldionne added a comment.
This revision is now accepted and ready to land.

LGTM with the different approach.



================
Comment at: libcxx/include/__assert:51-53
+#ifndef _PSTL_ASSERT
+#  define _PSTL_ASSERT(...) _LIBCPP_ASSERT((__VA_ARGS__), "")
+#endif
----------------
I would rather not start pretending that `_PSTL_ASSERT` is a customization point. Instead, I think we should do something like this inside `pstl_config.h`:

```
#if defined(_LIBCPP_VERSION)
#    define _PSTL_ASSERT(pred) _LIBCPP_ASSERT(pred, "")
#elif defined(__GLIBCXX__)
#   // does libstdc++ want something special? if so, they can add it here
#else
#    include <cassert>
#    define _PSTL_ASSERT(pred) (assert((pred)))
#endif
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125634



More information about the libcxx-commits mailing list