<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/78382>78382</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[C++20] [Modules] Incorrect linkage for in-class static data member
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:modules
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
ChuanqiXu9
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ChuanqiXu9
</td>
</tr>
</table>
<pre>
See:
```
// a.cppm
export module a;
export struct A {
static constexpr int table[] = {43, 44, 45};
};
```
According to https://eel.is/c++draft/class.static.data#6, the linkage of `A::table` should be the same with the `A`, which has external linkage instead of inline linkage. So we should be able to see its definition in `a.o`. But it is not true:
```
clang++ -std=c++20 a.cppm -emit-llvm -S -o -
```
Then we can't see the definition for `A::table`. It shows we didn't handle the linkage for `A::table` correctly.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEU02PozgQ_TXmUgIZ8xE4cEg6itSHPfUe9mpMEbxr7KxdTLr__chAf2TUmpGQwabq1atXfjIEfbWIHatOTIinaZH2f_3P0jIhWHVO5EKT893nedK74a17QWTFkfEz4-9rzfdn24oLExeQmbrd5u0IX2_OE8xuWAyCZMXp4TyQXxTBEdhh_wEQSJJWoJwNhK83D9oSkOwNRrrVGVhxjvFlwcQTlOW6Vuxw_gB_-P6F4roelXJ-0PYK5GAiuoXY2Moe0WQ6MHFRTJyYOA1ejhS3RoaQbdyyQZJkoqhjaZoQjLb_ySuCG4HV_BjBiuNGueYQJreYAXpcY4OcEe6apnW3htc8At0nrSaYZAB8JfRWmg9cHaWQQ8TX1mj7UTGDFwd3_FIiFo1dBUTQFGDAUVtN2lnQNpaTmWM1z-C0EGgCHcA6AvLLH4arjLTXTRNIAw2sOO8SCb6PHFKcNaXG_JghfYHUQfqbIfw9oY3clbRMHGhlHCX5wnh0_htBM3im2PE9xPRBD1v-JO1g8GEe3-eDct6jIvOWJUNXDG3RygS7_MCrsmpF0yRTl2M7llLmuWpaUVe5bMeq6athHEXF27ZMdCe4KHmeH7goc9FkYy0b2XBZjG1e11KxkuMstcmiHJnz10SHsGB3aIpGJEb2aMJuwE3a4ri5JOwu9F3MTPvlGljJjQ4UPrFIk1n9-_Q-g9UZ1emvHaM6w7PdG33QQ9t0vcvvPot3GWace_TJ4k33aIerpmnpM-VmJi6x-v5Kb979iyo6Y20rOmbt7GcAAAD__z8XUTo">