[PATCH] D105439: [clang] protects users from relying on libc++ detail headers

Christopher Di Bella via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 7 18:10:53 PDT 2021


cjdb added a comment.

I tried the following, but it doesn't work with modules, so it looks like a compiler solution is necessary.

  // in <algorithm>
  #define _LIBCPP_PRIVATE_HEADER_ALLOWED
  
  // in <__algorithm/find.h>
  #ifndef _LIBCPP_PRIVATE_HEADER_ALLOWED
  #error This is a libc++ detail header. Please instead include <algorithm>.
  #endif


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105439



More information about the cfe-commits mailing list