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

    <tr>
        <th>Summary</th>
        <td>
            [C++20] [Modules] <ranges> cannot be included in more than one module
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          camio
      </td>
    </tr>
</table>

<pre>
    ```C++
// A.cppm
module;
#include <ranges>
export module A;
```

```C++
// B.cppm
module;
#include <ranges>
export module B;
import A;
```

```
clang++ -fprebuilt-module-path=. -std=c++20 --precompile A.cppm -o A.pcm
clang++ -fprebuilt-module-path=. -std=c++20 --precompile B.cppm -o B.pcm
```

Compilation of the second file results in several errors like this

```
In module 'A' imported from B.cppm:6:
/usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/ranges:1258:2: error: 'std::ranges::views::_All::operator()' from module 'A.<global>' is not present in definition of 'std::ranges::views::_All' provided earlier
 operator() [[nodiscard]] (_Range&& __r) const
 ^
/usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/ranges:1258:2: note: declaration of 'operator()' does not match
        operator() [[nodiscard]] (_Range&& __r) const
        ^
```

This is using clang trunk and libstdc++ that is distributed with gcc 12.2.1.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMlUGPqzgMgH-Ne7FAkLS0c-BApw9pD3tZ7X0UEheyLyQoCZ3Zf78K0M683dHqHebwEIIk2Mb-bCciBN1bohoOZzhcdmKOg_O1FKN2u86pv2uoivV-BnZOd3GBogHWAmuxyeU0jevS6NRsCPhDgmsrzawIgT97YXsKwL-tH-ltcj7iqoLNu9L9Z9v0x8XPPDh_iQfnh5Iel_WfdWmdSiNsvzqH2XXy1M3axGw1nk0iDsAvOWYhKuAXuUqyArNs8i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