libc++ has started splicing standard library headers into much more
fine-grained content for maintainability. It's very likely that outdated
and naive tooling (some of which is outside of LLVM's scope) will
suggest users include things such as <__algorithm/find.h> instead of
<algorithm>, and Hyrum's law suggests that users will eventually begin
to rely on this without the help of tooling. As such, this commit
intends to protect users from themselves, by making it a hard error for
anyone outside of the standard library to include libc++ detail headers.
This is the first of four patches. Patch #2 will solve the problem for
pre-processor #includes; patches #3 and #4 will solve the problem for
<__tree> and <__hash_table> (since I've never touched the test cases
that are failing for these two, I want to split them out into their own
commits to be extra careful). Patch #5 will concern itself with
<__threading_support>, which intersects with libcxxabi (which I know
even less about).
All your generated headers have this newline at the beginning -- they shouldn't.
I also think they should have a newline at the end (might not be required technically but we always do that).