_LIBCPP_ENABLE_ASSERTIONS is deprecated, and will be removed. See (from libc++ __config in main):
TODO(hardening): remove this in LLVM 19. This is for backward compatibility -- make enabling
_LIBCPP_ENABLE_ASSERTIONS(which predates hardening modes) equivalent to setting the safe mode. ifdef _LIBCPP_ENABLE_ASSERTIONS warning "_LIBCPP_ENABLE_ASSERTIONS is deprecated, please use _LIBCPP_ENABLE_SAFE_MODE instead."
From LLVM 17, _LIBCPP_ENABLE_DEBUG_MODE can be used instead, which also performs more checks than safe mode:
Enables the debug mode which contains all the checks from the hardened mode and additionally more expensive checks that may affect the complexity of algorithms. The debug mode is intended to be used for testing, not in production. Mutually exclusive with
_LIBCPP_ENABLE_HARDENED_MODEand_LIBCPP_ENABLE_SAFE_MODE.
See https://libcxx.llvm.org/Hardening.html.
Related to #28476.