<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/68490>68490</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] template specialization + member function template with default arg and alignof crash
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
rfenelus
</td>
</tr>
</table>
<pre>
```c++
template<typename TemplateParam>
struct Problem{
template<typename FunctionTemplateParam>
void Func(int param = alignof(FunctionTemplateParam));
};
template <>
template<typename FunctionTemplateParam>
void Problem<int>::Func(int param) {}
int main(){
Problem<int> p = {};
p.Func<char>();
}
```
This bit of code causes a crash where it correctly compiles in msvc and gcc. With my local clang install (windows, x64) it seems to at least compile successfully replacing alignof with sizeof but I can't reproduce this behavior on godbolt.
[Godbolt](https://godbolt.org/z/4zhT1eP8s)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU02PqzgQ_DXNpfUiaD4CBw4zybLa2xxG2rMxDXhlbGSbmU1-_cokeXk7O5eVLMWxi-qqarfwXk2GuYXyFcpzIrYwW9e6kQ3rzSe9HS4tVOltSaDXuNIzpC-Bl1WLwJCfwmVlIxbG9_vZm3Bigfy3G9IHt8mAb872mhc43gkQv6PoNiODsuZ7KsQPq4YdBFQrE3CN9wj5GYVWk7EjUP09BzVx5ffqcDw_9_8yhJCffhb8_xJ3gQ-v-UmZEK_yF8hfvsoGajDGcTz_qiNeL0IZoDoKfsaF_6HFdXd-53jYwfWwV8pPchYuVr8x_Wr9tnk09vb3fVYeexXQjijtwCjF5tmjQOmEn_FzZseoAkrrHMugLyjtsirNHpXBxX9IFGbAScoD_qnCjMsFtZVCo9TCTKiMD0JrBKo_lRnspwc64d9VEYNQAT3z4jFYFAE1Cx8e_Og3Kdn7cdP6go5XLaQy06Pl-BmLeXVlO2K_BfwDpTBAxxCxzg6bZAy7O57Fh7IOrcHJDr3V4XDPonz9_XYA5RmonkNYfWwbdUDdA2vdBNRdgbriOr9n_FZ7oCYZ2nxo8kYk3GZVU1VNnRVpMrf5sSEq87rMskz0KdNYj3WdU1XWFTWSEtVSSnmWpsfsmFJWHopMZMWQRYQoZT1CkfIilD5o_bHE8onyfuO2qosmTbToWft9eIn2jIEozrFrI_5Hv00eilQrH_yTIaig94m_fVGefw4i-pWlElpdRXzgCPSKCy89Oxzvj_6J3UMfeBSbDijctPf-0ZH9xSSb0-2XIFWYt_4g7QLURUX3nx-rs3-xDEDdbtADdbvHfwIAAP__kD53Ug">