[libcxx-commits] [libcxx] [libc++] Stabilize transitive includes for C++23 (PR #134143)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Wed May 14 13:20:17 PDT 2025
philnik777 wrote:
> > I think the rationale makes sense, but I'm not actually sure the solution is the right one. Would keeping the public headers actually help with the breakages you've seen?
>
> I think it would, as with all the other transitive includes breakages? You seem to imply that we'd want another solution, but I'm not certain I follow your thought here. Can you elaborate?
We're not including top-level headers anymore in most of places. Consider for example `<functional>`. The header provides `vector`, but `<vector>` isn't listed in the transitive includes of `<functional>` in C++23, since we only include `<__vector/vector.h>`. That means that if we managed to remove that dependency, the transitive includes test would be completely happy, even though we've probably broken some user by removing it. This change will make it less likely that we're breaking someone through granularizing non-granular headers, but that basically doesn't happen anymore anyways. We're more likely to move some code around and remove a dependency that way I think.
Also, somewhat tangential, IMO we'll need to give users some way to get include-clean. Keeping this cruft around is a huge hit on compile times, and the transitive include test probably made things a lot worse, since we've never dropped any transitive includes, no matter how long they were actually in the library. #139855 seems related.
https://github.com/llvm/llvm-project/pull/134143
More information about the libcxx-commits
mailing list