[libcxx-commits] [PATCH] D154997: DRAFT [libc++][hardening] Deprecate `_LIBCPP_ENABLE_ASSERTIONS`.

Konstantin Varlamov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 12 18:28:44 PDT 2023


var-const marked 18 inline comments as done.
var-const added inline comments.


================
Comment at: libcxx/include/__config:258
 
 // Hardened mode checks.
 #  if _LIBCPP_ENABLE_HARDENED_MODE
----------------
ldionne wrote:
> I think we might need to move the categorization to `__assert`, otherwise we're depending on `_LIBCPP_ASSERT` and `_LIBCPP_ASSUME` that are defined in `__assert` (and there's a circular dep if you try to include `__assert` from `__config`).
I //think// it should be fine. This seems to work across all compilers (https://godbolt.org/z/o6dq7MaoT) and this part of the example in the Standard:
```
#define m(a)    a(w)
#define w       0,1
// (http://eel.is/c++draft/cpp.rescan)
```
also seems to confirm that we can rely on the other macro being substituted during the rescan.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154997



More information about the libcxx-commits mailing list