<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54189>54189</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[C++20] [Modules] Reject exporting template specialization for which the original name is not exported
</td>
</tr>
<tr>
<th>Labels</th>
<td>
c++20
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
ChuanqiXu9
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ChuanqiXu9
</td>
</tr>
</table>
<pre>
Now the compiler would crash for the following example:
```C++
export module m;
template <class T>
void f1() {
}
export template <>
void f1<int>() {
}
```
After https://reviews.llvm.org/D120397 landed, the compiler wouldn't crash and accept it. However, the behavior is incorrect, too. According to C++20 spec, we couldn't export a name which is not exported before. So we need to find a solution to reject it.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1Uk2PmzAQ_TXmMioyJgnLgUM2adRLe2h76NXYA3hlMLVN2PbX1waSTb8kC-Q3njdv3kxt5I_qk5nBdwjC9KPSaGE2k5YgLHcdNMYuwcZobWY1tICvvB81kvxI6JnQIznQ9ZwIe45nQfF1NNZDb-SkEXqSb_j69RgouEcg-Ulo7hx8Jfn7NXY1SkKTEfZEWAmkuCUW50eGjf-R6C-G_KQGH9H_Ut2kPzIfGx886LwfXeyRXcKxeFU4u1Tra58a2wbonDGalwVoPkiUhJ3-4eFAWOE3I8Mz4ELg6EH5FD6YGa9ob3k1dvyqgtfKgRqEsRaFX4LGpHAUAZHRfG9gs5lRcCOK-GaOde_lNmc4DLxHmDslusg6mFsIZSgX5oopfDExecAABeZGRY3gjJ68MkOELL4EIVFxIqtclnnJE6-8xorsn-9KyP4M4f5xGbaLt89r3lpwEX4bVBStuFY_-VIj7teqMdpgrGrVwPWq_Q_VyWR19ftcWuW7qU6D6-ESh7P93o3WvCwOXpRzU9DELvtd9lQmXVXvmWQlPeS0Ebv9oc4EE1wesnpX0CLbZYnmNWoXGySMiXuPjIXGElUxysLk6Y6yjGZZWhZZ3VCJRY6HOucN2VHsudL3XUlstUiqp9aFoFbOvy1SEnZftWEAW7lTN_Hhu_o2lVs9PvnO2OoNT5aGqqWbX-YpLVU">