ian-twilightcoder 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.

Sure, but if you can't include `<assert.h>` from a modular header, then that 
basically means `<assert.h>` can't itself be a modular header. 
`<modular_header_that_has_an_assert.h>` doesn't usually start its life as a 
modular header, it just has an inline function with an assert in it, and 
doesn't expect its behavior to change and start ignoring NDEBUG when it becomes 
a modular header. In a single module world, fine `<assert.h>` can function the 
same as textual, but when you add in a second world it starts behaving 
differently with and without modules.

https://github.com/llvm/llvm-project/pull/165057
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to