[libcxx-commits] [PATCH] D106124: [libcxx][modules] protects users from relying on ranges detail headers

Christopher Di Bella via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 16 11:15:29 PDT 2021


cjdb added inline comments.


================
Comment at: libcxx/test/libcxx/diagnostics/detail.headers/ranges/view_interface.header.verify.cpp:13
+// expected-error@*:* {{<__ranges/view_interface.h> is a libc++ detail header and can't be directly included by users. Please '#include <ranges>' instead.}}
+#include <__ranges/view_interface.h>
----------------
zoecarver wrote:
> Could these tests be turned into a custom shell test that automates all this? I don't really want to have to do //another// thing every time I add a header file. 
> 
> (You can use `RUN: <whatever>` [[ https://github.com/llvm/llvm-project/blob/main/libcxx/test/std/namespace/addressable_functions.sh.cpp#L15 | like this ]].)
The idea will be to use the same Python test for private modules. I did it by hand for this one for two reasons:

1. I wanted to showcase a small patch to get the discussion going. Your RFC has vindicated this first one.
2. I haven't yet worked out a way to safely automate code injection so it can be applied to all our headers at once.

But yes, automating this will happen by the time I look at `<algorithm>` (I am NOT writing ~120 of these by hand).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106124



More information about the libcxx-commits mailing list