[libcxx-commits] [PATCH] D157363: [libc++][Modules] Remove unnecessary `requires` from the module map

Ian Anderson via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 7 23:42:34 PDT 2023


iana added a comment.

For background, `requires` is generally used like this.

  module ABC {
    header "plain.h"
    module NeedsCPP {
      requires cplusplus
      header "needs_cpp.hpp"
    }
  }

Building ABC would normally precompile both headers, but with the `requires` in place, needs_cpp.hpp will be skipped if the module is built in pure C mode. If NeedsCPP is a top level module, the `requires` isn't necessary anymore and dirties up the module map. In the libc++ case, not all the `requires` are even accurate, some of the headers are include-able without the feature. e.g. stdatomic.h doesn't actually require C++23, it will `#include_next` in earlier versions and still be buildable. I found that out while testing D157364 <https://reviews.llvm.org/D157364> but figured this deserved its own review.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157363



More information about the libcxx-commits mailing list