dblaikie added a comment.

Just a thought (nothing to hold up this patch/suggest a revert/suggest any 
immediate action), but:

> The problem with extending this to non-system headers is that you need a way 
> to tell which headers are allowed to include the detail headers and which 
> ones are not.

What if the analysis was done on the entire #include path from the current 
primary source file - rather than from the immediate include location? Then the 
requirement could be "This header must be directly or indirectly included from 
one of the headers listed in include_instead, otherwise there will be a 
warning" - could that generalize to other use cases/not only system headers?

(not entirely sure how this'd interact with modules, though - but perhaps that 
could be handled a bit differently, by having private modular headers that can 
only be included from within a module, not by clients of a module)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106394/new/

https://reviews.llvm.org/D106394

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to