[clang] [clang][docs] assert.h is not a good candidate for a textual header (PR #165057)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 24 17:08:17 PDT 2025


zygoloid wrote:

> As a textual header:
> #define NDEBUG
> #include <modular_header_that_has_an_assert.h>

This isn't a problem with `<assert.h>`. If `<modular_header_that_has_an_assert.h>` intends to pick up the state of the `NDEBUG` macro from the translation unit that includes it, then it's not a modular header, and shouldn't be declared as one.

https://github.com/llvm/llvm-project/pull/165057


More information about the cfe-commits mailing list