<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61642>61642</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Error with C++ modules: not present in definition provided earlier
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
rnikander
</td>
</tr>
</table>
<pre>
Here is a boiled down version of something happening in a real project.
`Mod1.cc`
```c++
module;
#include <ranges>
export module Mod1;
```
`Mod2.cc`
```c++
module;
#include <iterator>
#include <valarray>
#include <ranges>
export module Mod2;
import Mod1;
```
`build.sh`
```sh
CXX="/Users/rob/Dev/llvm-project/build/bin/clang++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -std=c++2b"
set -e
$CXX -fprebuilt-module-path=. -x c++-module Mod1.cc --precompile -o Mod1.pcm
$CXX -fprebuilt-module-path=. -x c++-module Mod2.cc --precompile -o Mod2.pcm
```
Errors:
```
In module 'Mod1' imported from Mod2.cc:6:
/llvm-project/build/bin/../include/c++/v1/__ranges/zip_view.h:494:40: error: 'std::__1::ranges::views::__zip::__fn::operator()' from module 'Mod1.<global>' is not present in definition of 'std::__1::ranges::views::__zip::__fn' provided earlier
_LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Ranges&&... __rs) const
^
/llvm-project/build/bin/../include/c++/v1/__ranges/zip_view.h:491:40: note: declaration of 'operator()' does not match
_LIBCPP_HIDE_FROM_ABI constexpr auto operator()() const noexcept { return empty_view<tuple<>>{}; }
^
/llvm-project/build/bin/../include/c++/v1/__ranges/zip_view.h:494:40: note: declaration of 'operator()' does not match
_LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Ranges&&... __rs) const
^
1 error generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVt1u2zgTfRr6ZiBBJmXJvvCFfyI0-L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