<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61360>61360</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Modules] structs declared in different modules conflict with each other
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
davidstone
</td>
</tr>
</table>
<pre>
Given the following two translation units
```cpp
export module a;
export template<typename>
struct holder {
};
export struct a {
holder<struct foo> m;
};
```
```cpp
export module b;
import a;
struct b {
holder<struct foo> m;
};
```
When compiled with
```shell
clang++ -std=c++20 -x c++-module --precompile -c a.cpp -o a.pcm
clang++ -std=c++20 -fmodule-file=a=a.pcm --precompile -x c++-module -c b.cpp -o b.pcm
```
Causes clang to fail with
```console
b.cpp:6:16: error: declaration of 'foo' in module b follows declaration in module a
holder<struct foo> m;
^
a.cpp:8:16: note: previous declaration is here
holder<struct foo> m;
^
1 error generated.
```
I'm not 100% sure of what the standard mandates here.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVM2u6yYQfhq8GdmyIbZzFl4kJzdVF113PYZxTIXBApzc-_aVf3JymqbtqXRRAob5-b6ZgcEQ9MUSNaw8svKU4BR75xuFV61CdJaS1qkfzS_6ShZiT9A5Y9xN2wvEm4Po0QaDUTsLk9UxsPzE8sM2V_n6k-O4ntD30fkIg1OTIUAmjp_1N2mkYTQYiYn3-GMkiwMx8W1VCdFPMkLvjCIPrL7b16fXvjZ9_KSav63WTLxv0s45Jr7B8HDx2d09iP8TWfvERg-L9DngDb_9yex-78mCdMOoDSm46di_5B56MmY9kwbthfEj40dIQ1RMnOS65Tmk32HbpFt4aTp62gAglYCZHEdIHWA2yuErLrvVU9ppQ0yccP7Ptk-u_44sob2DtQ-wl2l4xylQgIUIRAcdavPP2ZDOBmdoPV0wmDhUTByKeQLy3vn5Q5E06Ncb7zpgvJ4LxGvQ9qP62yMJf1F-yHEFgW38Z8GBldv1x43X_oOXdfNDOcDo6ard9AQZoCe_xfQFnJfjA7xYkwAXsuQxksr-Jfm_Ml4PMzso8pzxEsLkaU7Yrce4NJIQ0Sr0CoZ5jbRyzRLVCPUm3jChpqjqfbXLi5onfcNb6nZVrSrclQXtUexkq2qFqFTZ1gUluuE5F7koeFGVVcEz3hYSd1W5V1WxL94qtstpQG0yY65D5vwl0SFM1FSFqPLEYEsmLH2Qc0s3WISM87kt-ma2SdvpEtguNzrE8PASdTRLA_1tqW9g5WlrPPdykJrLr3TXkSd7bxMBpLOd0TIu1xIIZQ8u9uSTyZumj3EMTBwYPzN-vujYT20m3cD4eYbelnT07g-SkfHzQjgwfl4C-jMAAP__3s68ZA">