<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/71364>71364</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            C++20 modules available but `__cpp_modules` not defined
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          boris-kolpackov
      </td>
    </tr>
</table>

<pre>
    While Clang now enables C++20 modules by default with `-std=c++20` and later, it does not appear to define the `__cpp_modules` feature test macros (which should have the value of `201907L`; see https://en.cppreference.com/w/cpp/feature_test). I've tested this with up to Clang 18 pre-release (`20231102103655+18839aec4ed1`).

Is there a reason for omitting this macro for now or is it an oversight that could be fixed? In `build2` we currently define this macro on the command line which adds quite a bit of noise.

@iains @ChuanqiXu9 @dwblaikie 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsk82O6zYMhZ9G3hAJZDpx4oUXNzMIMED37S6gJTpWR5Z89ZN03r6QnfZi0G4SWLLPOfxIUozm7ph7cbyI43tFOU0-9IMPJu4-vV1IffpHNXj91f8-GcvwZsndwfknsKPBcoQ3gReBF5Qwe53LyfAFmkfKNsHTpAlEK3cxadG8q3_eFa0EchosJQ4C38Ak0J4jOJ-AloUpQPJFxjiGNHERud3UstxeLkVhZEo5MCSOCWZSwUcQeH5ORk0QJ5-thokem8CDbGbwY1FCWXfy9JtopWguEJlhSmmJovkh8Crwym6vliXwyIGd4r3ys8DrU-BVLYvA68v4VowFdnv4EHh6bEFYQ5pM3ErPSyljg1afYQm8C2yZIpegaxJs6lpiLZv2eBR4qc_npiNWB9Z1yYfdXsh3IX9svx-xFBMYCAJT9A5GH8DPJiXj7pvzSmI9L33yAUwsfMmBf3CI5j4lSBMlUCuhgWE0f7EWzRU-XMEzZGM1FsJPBpVDYJfs169u_Ovh3YpW-Xleu1muN_qkdYSf2aSSdDCpgHfeRP5WjThIQ8ZFEAf5NmVyP80fuStP-jlYMp-GodJ9o7umo4r7uu06PJ46WVdTf2LN3ek8HoiO47FGiW1LQyeZJGpmqkz_otvKszzKet-cWkmoTvowEqJCcZA8k7F7ax_z3od7ZWLM3J_qpj1Ulga2cV0NRMdPWC8FYtmU0JdvdkO-R3GQ1sQUf6kkkyz3_10MepCxZWtgyOl_J7qM_4ZZVznY_vtY3k2a8vCaxuL2-tstwf_JKgm8rhmjwOtaw98BAAD__7tMQIM">