[libcxx-commits] [libcxx] [llvm] [libc++] Deprecate and remove meaningless `<cxxx>` headers (PR #111615)
Ian Anderson via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Oct 22 10:39:37 PDT 2024
ian-twilightcoder wrote:
> I'm fine with the patch in principle, but we do have a problem that the modules for these now-deprecated headers get built whenever the `std` module is built, which breaks the compilation of anything that builds the `std` module. I pulled this down locally to play around and even making these modules `explicit module ccomplex` doesn't fix the issue, so I'm not certain how to fix this.
>
> @ian-twilightcoder Do you have ideas? Basically, the TLDR is that we have headers that now contain an unconditional `#warning` directive and we'd like these headers not to be pulled into the `std` module's compilation unless they are requested explicitly. Making these headers `textual` solves the problem but that seems like a hack.
You really can't use `#error` or `#warning` in modules because the headers all build with the module, and there's no way to trigger a diagnostic on import rather than during build. `textual` will cause issues with duplicate declarations, that can only really be used if 1) there aren't declarations (e.g. x-macro headers) or 2) there is only one includer.
So for now I think you have to check if modules are enabled and don't `#warning`. We're investigating syntax to mark submodules as deprecated, and also entire headers.
https://github.com/llvm/llvm-project/pull/111615
More information about the libcxx-commits
mailing list