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

    <tr>
        <th>Summary</th>
        <td>
            [C++20, Modules]Erreur when importing<string> and <iostream>iostream
        </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>
    Hi,
building this simple snippet

```cpp
import <string>;
import <iostream>;

int main() {}
```

provoke this error
```
error: @programdir/modules/private/async/runjobs.lua:256: @programdir/modules/private/action/build/object.lua:91: @programdir/modules/core/tools/gcc.lua:709: In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:987:3: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a)
  ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
 ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:979:55: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(_InputIterator __first, _InputIterator __last)
 ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
      ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:975:93: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(
 ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
      ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:969:93: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(
 ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
      ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:964:3: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 basic_string(const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a = allocator_type());
 ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
      ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:951:3: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 basic_string(const basic_string& __str, size_type __pos, const _Allocator& __a = _Allocator())
  ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
 ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:948:3: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 basic_string(const basic_string& __str, size_type __pos, size_type __n, const _Allocator& __a = _Allocator());
 ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
      ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:945:55: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c, const _Allocator& __a);
 ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
 ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:908:55: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c)
 ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
      ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:901:3: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 basic_string(const _CharT* __s, size_type __n, const _Allocator& __a)
 ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
      ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:893:55: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, size_type __n)
 ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
      ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:887:55: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, const _Allocator& __a);
 ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
 ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:879:55: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s)
 ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
      ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:862:55: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(basic_string&& __str, const allocator_type& __a)
 ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
      ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:849:55: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(basic_string&& __str)
 ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
      ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:846:33: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const basic_string& __str, const allocator_type& __a);
 ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
      ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:845:33: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const basic_string& __str);
 ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
 ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:834:64: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const allocator_type& __a)
 ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
 ^
In module '/usr/bin/../include/c++/v1/iostream':
/usr/bin/../include/c++/v1/string:827:55: error: 'std::basic_string<char>::basic_string' from module '/usr/bin/../include/c++/v1/iostream' is not present in definition of 'std::string' in module '/usr/bin/../include/c++/v1/string'
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string()
 ^
/usr/bin/../include/c++/v1/string:657:7: note: definition has no member 'basic_string'
class basic_string
```

commands used:

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

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

/usr/bin/clang -c -Qunused-arguments -m64 -stdlib=libc++ -std=c++20 -fmodules -fno-implicit-module-maps -fmodule-file=build/stlmodules/cache/string.pcm -fmodule-file=build/stlmodules/cache/iostream.pcm -o build/.objs/hello/linux/x86_64/release/src/test.cpp.o src/test.cpp
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsm1tv4jgUxz-NebGCgkMCeeCBAtFEml52inbnLXIcQ9x17Mh2Ou18-pUTaAu9M23VrlzRUnw5sf_nl5MTB2Ot2VpQOgHhEQjnPdyYUqrJVJkS1797uSyuJ98YQDPgz4E_zRvGCybW0JRMQ82qmlOoBatraroWm7-R371IXXclrKqlMhAEM20UE2sQLEBwtF_HpDaK4upu7aaNMLDCTAA0BiiGYHQERvO9g91tXyt5Kf-l3UCpUlI92LirCaYQDP1aybXCVcEUQEkli4ZTDVBSK3aJDQUowfpaEIAS1YgLmes-bzAIpiiMXmyAGCYFQEmrI0CJzC8oMRtD8eBpO0Qqa8RIye3HNSGbjiM_tj1TAbvGEKARQEmjbf_capb0-wAlTBDeFNYGAeiofSWXA1uxlR2NQLB14WsMbH06jcfWQmCHcystGmlTWMPBNMeakWzbfEZKrFpf36tDI7hSsnqDGUGmoZAG1opqKgxkAhZ0xQSzvoBytTO-26Ozg9W8sdEJCXfnNc5SUTcmNVRhIxXMshVT2gA0g_dqOO4qiBTaQMy5JLYmM9c1BSiCWYYBijeHgSBc_InrotC6zv5auah9v6NTia2KsKJVTpWVZM9b3ZEJx1rvTrgb3M3YPgWkI3u-hKGj9A6l2ff0aHZ2ln1L54ss-XF6nE2P0pvS2enJ-XLx8-xHdp6ezBbZ7OdP5P8x2fE-HZ-Q3Pbnk-FryY1dkH0I3-PF8tvpPFsujs--T5eLLD0--57O0mWWnpwvpyfLdLpMT0-yv9PzZ9imVzVnhJl9yB2yhyAbxQ5Zh-zXQnboMtmnM9kuLc2WdZeLtld6zX7TNj-FWVZLvV8knklnIQjm92rsHZ99be8IHcmvIzkcOJJfQvJuoeVRG_UI1Bv2p1tU7_J7t3TLrrtHeyW0w7GD9q2hfSQSv5xiF4EPhDl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