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

    <tr>
        <th>Summary</th>
        <td>
            No known conversion with same type when splitting a module into implementation and interface file
        </td>
    </tr>

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

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

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

<pre>
    I faced an issue when trying to split a named module into interface and implementation files, but I stumbled upon another very basic problem when trying to create a minimum reproduction case. Maybe I missed something?

I have two modules: `mod1` and `mod2` with a circular dependency.
Here is `mod1.cppm`:
```c++
export module mod1;
import mod2;
export namespace test
{
    struct S
 {
        int a = 1;

        void dump()
        {
 do_dump(this);
        }
    };
}
```
Here is `mod2.cppm` containing the interface:
```c++
export module mod2;
namespace test
{
    struct S;
    export void do_dump(S *);
}
```
And here is the implementation `mod2.impl.cppm` file:
```
module;
#include <iostream>
module mod2;
import mod1;
namespace test
{
    void do_dump(S * s)
    {
 std::cout << s->a << "\n";
    }
}
```
Finally, I build my modules with the following command line:
```console
$ make
clang++-15 --precompile mod2.cppm -o mod2.pcm -std=c++20 -fprebuilt-module-path=. -Wall -I.
clang++-15 --precompile mod1.cppm -o mod1.pcm -std=c++20 -fprebuilt-module-path=. -Wall -I.
mod1.cppm:12:13: error: no matching function for call to 'do_dump'
 do_dump(this);
 ^~~~~~~
/home/etham/test_modules/bug_no_known_conversion/mod2.cppm:5:17: 
note: candidate function not viable: no known conversion from 'test::S *' to 'test::S *' for 1st argument
    export void do_dump(S *);
 ^
1 error generated.
```

Please find enclosed the related files and Makefile:
[bug_split_modules.zip](https://github.com/llvm/llvm-project/files/10328588/bug_split_modules.zip)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVk-P4rgT_TTmUgpKHELgwIFuBv36MD-tNIc9thy7IN7xn8h2YNnDfvaVn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