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

    <tr>
        <th>Summary</th>
        <td>
            [C++20][Modules] Can't import <complex> and <iostream> at the same time
        </td>
    </tr>

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

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

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

<pre>
    this snippet fail to build on df34581d2b004e20fda85b4c8617bf436e826f6c with https://reviews.llvm.org/D142704 applied

```cpp
import <iostream>;
import <complex>;

using namespace std;

int main(int argc, char** argv)
{
    cout << "hello world!" << endl;
 return 0;
}
```

```
/usr/bin/clang -Qunused-arguments -m64 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -std=c++20 -fmodules -fno-implicit-module-maps -stdlib=libc++ -DNDEBUG -fmodules-cache-path=build/stlmodules/cache -c -Wno-everything -o build/stlmodules/cache/iostream.pcm -x c++-system-header iostream

/usr/bin/clang -Qunused-arguments -m64 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -std=c++20 -fmodules -fno-implicit-module-maps -stdlib=libc++ -DNDEBUG -fmodules-cache-path=build/stlmodules/cache -c -Wno-everything -o build/stlmodules/cache/complex.pcm -x c++-system-header complex

/usr/bin/clang -c -Qunused-arguments -m64 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -std=c++20 -fmodules -fno-implicit-module-maps -stdlib=libc++ -DNDEBUG -fmodule-file=build/stlmodules/cache/iostream.pcm -fmodule-file=build/stlmodules/cache/complex.pcm -o build/.objs/stl_headerunit_cpp_only/linux/x86_64/release/src/main.cpp.o src/main.cpp
error: /usr/bin/../include/c++/v1/ostream:254:20: error: 'std::basic_ostream<char>::operator<<' from module '/usr/bin/../include/c++/v1/complex' is not present in definition of 'std::ostream' in module '/usr/bin/../include/c++/v1/iostream'
 basic_ostream& operator<<(basic_streambuf<char_type, traits_type>* __sb);
 ^
/usr/bin/../include/c++/v1/ostream:221:20: note: declaration of 'operator<<' does not match
    basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&))
 ^
/usr/bin/../include/c++/v1/ostream:225:20: note: declaration of 'operator<<' does not match
    basic_ostream& operator<<(basic_ios<char_type, traits_type>&
 ^
/usr/bin/../include/c++/v1/ostream:230:20: note: declaration of 'operator<<' does not match
    basic_ostream& operator<<(ios_base& (*__pf)(ios_base&))
 ^
/usr/bin/../include/c++/v1/ostream:233:20: note: declaration of 'operator<<' does not match
    basic_ostream& operator<<(bool __n);
 ^
/usr/bin/../include/c++/v1/ostream:234:20: note: declaration of 'operator<<' does not match
    basic_ostream& operator<<(short __n);
```


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsV01v8zYM_jXKhXBgU_7KIYe0qXfahh2GHQ1ZlmO9kCVDktN2v36QnaRN2r0fQ9FhwIDAjkWR5vOQIk3mnDxoIbYkuyPZfsUm3xu73Vnfs_HPVWPa563vpQOn5TgKDx2TCryBZpKqBaOh7WialUmLTRynAuOuZWXWpLzMk6LpUpqLEvMu5_AofQ-996MjdEewIlhZcZTi0a2VOg5rYw8Eq32SYhGnwMZRSdGSeE_i3emax8uPj-OyIofRWA-E3kvjvBVsIPSB0LtbKTfDqMTTa-FynZzUB9BsEG5kXIDz7c0OqT0MTGqCZfjL7IETvAfeM0twR3AXlo4ENyel4qQNAMDNNL-e0HsgiL1QysCjsaolmBDEs0zoVl1eC1b4yWqIXxwp9jcEvMvK6RGryVmCVRN8rrhi-gDRb5OenGgjZg_TILR3EA15ClF3lE42Ukn_TOi-l20r9NVqJLWSWrjoLPuVQjSztOcE7wjeYQxRN5h2UsJB1GkTyWFUkksfLavRwEY3KynZELpXsjmpQrT_Zf9w9_tPLxYizngvopH5ntD9nGQEK-fVSR4ghR0QcYj-0CYSR2GffR_CGJ2y8l0FgtU5R9YjHyB6gpMXkXt2XgxRL1grLFwy6TXH_5P6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