[clang] [clang][modules] Headers meant to be included multiple times can be completely invisible in clang module builds (PR #83660)

Ian Anderson via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 16 14:45:58 PDT 2024


ian-twilightcoder wrote:

> To get back to my previous point about the semantics implemented by this patch being unfortunate -- the upshot is that, now:
> 
> ```
> #include <assert.h>
> #define NDEBUG
> #import <assert.h>
> ```

It would be nice if we could make this work without modules too. `#pragma many` or something would do that, but I fear we'd have compatibility issues if we added a pragma that's only supported by clang to a bunch of system headers.

> This doesn't make sense: with modules disabled, everything is textual -- to say that "textual header" in a modulemap should make a header somehow "more" textual than the default non-modular behavior is weird.

With modules disabled, everything isn't textual - it's effectively excluded. `textual` was probably not the best name for that keyword in the module map.

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


More information about the cfe-commits mailing list