<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62265>62265</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] crash when meeting template friend function
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang,
crash
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
HerrCai0907
</td>
</tr>
</table>
<pre>
```c++
template <class T> int Foo(T X);
template <int N, int B, int C> struct Thief {
template <class T> friend int Foo(T X) {
return B;
}
};
template struct Thief<1,2,3>;
int main() {
Foo(1.0);
}
```
https://godbolt.org/z/vEGdvhc3q
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0Uk-Pmz4Q_TTDxdrIjPkTDhw2JPx-p55y6NWYCbgyOLVNqvbTVwZ2s-q2kiVm0Hvz3vyR3uthJqohP0F-TuQSRuvq_8m5Rmpe8TLpbP-zhoJvTwGe4uNn4K-BpruRgRiIRhnpPbuCuDA9B9ZaC3i8sq-AFYi_4CPoC2Czok9vQRP5PrhFBXYdNd0YlDuZ_UPt5jTN_SfRSGQ7kzHmKCxuZicQ73-hPG9RDD5Z_GgCRJMCNgjYCBCXd3DUnKSeAY-74l56M5Ie-Mfun3pvw9zSMYS7B_EK2AK2g-07a8LBugGw_QXYPi7_9Y9Rie8bPOlr0VeikgnVaXFEzvMMMRnrkivqu4pjVeSqKtOCcsLu2Ins2FdpWiW6Ro6CZ8jTPBMZHjolZNHzvhRF2t1IQcZpktocjHlM0UGivV-oLhCLPDGyI-PXS0FURs4DYBxJzJz0Y8zyc-LqyH7plsFDxo32wT_rBR3MemwbPz-zlcp-jDSziSjoeXguel_tbZlV0HZOFmfqP6alw7h0B2UnwDaq7J-Xu7PfSAXAdm3BA7ZrF78DAAD__6632yI">