Framework vendors usually layout their framework headers in the following way:
Foo.framework/Headers -> "public" headers Foo.framework/PrivateHeader -> "private" headers
Since both headers in both directories can be found with #import <Foo/some-header.h>, it's easy to make mistakes and include headers in Foo.framework/PrivateHeader from headers in Foo.framework/Headers, which usually configures a layering violation on Darwin ecosystems. One of the problem this causes is dep cycles when modules are used, since it's very common for "private" modules to include from the "public" ones; adding an edge the other way around will trigger cycles.
Add a warning to catch those cases such that:
In file included from test.m:1:
./A.framework/Headers/A.h:2:10: warning: public framework header includes private framework header 'A/APriv.h' [-Wframework-include-private-from-public]
This only works for the layering violation within a framework.
Depends on D47157