<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63246>63246</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang frontend C++ crash on invalid code when missing `std::enable_if` argument
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
brutalsavage
</td>
</tr>
</table>
<pre>
To quickly reproduce: https://gcc.godbolt.org/z/Gx9Wj56vT
```cpp
#include <type_traits>
template <typename T>
constexpr bool foo = decltype((T*)0)::value;
template <typename T, typename = std::enable_if<!foo<T>>>
bool bar = true;
int main(){
bar<decltype(0)>; // incorrect here because its missing an argument.
return 0;
}
```
Compiling the above invalid code crashes clang `clang++ -x c++ -std=c++23`, crashes locally using clang-17.0 (a10019a), also on trunk (see godbolt link)
Note: having a correct invocation of the template like this
```cpp
bar<decltype(0), decltype(1)>;
```
removes the crash and compiles
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVE-P46gT_TSVS6kjDIljH3xInMnv9ju1tMcRxhWbaQxewJ7u_fQrSCaTme2VVkIYTP159eqBDEEPlqiB_Qn2541c4uh80_klShPkKgfadK7_aF4d_rlo9WY-0NPsXb8oAnHEMcY5gDgCvwC_DEptB9d3zsSt8wPwy1_AL_97r__4ti_XV2BnYMf7XLLbUPN8_8OFtsosPSGINn7M9DV6qWMA8eXZM9I0GxkfVlZOhK8PI-VsiPQ-e-ycM3h1DkGcsSdlkjXwCnj1CvwIvGbA6wReHFdpFgJx-g-JeIuPXYocYn-LQVZ2hr7qK4gWeHF1DkSbgd1GDppBddJn1-j_kVTbiJPUNuOs4XA_TC4g2qcqbti_gDjhjXzUVjnvSUUcyRN2pOQSCHUMOOkQtB1QWpR-WCaycXsP7Cku3iL7ieNw_q1Fz_haN83apFhxJJSdWwm1XaXRPSrXEyovw0gBlZF2wNTgtAB-An7Cl3dUP5aZt_N9y0XKw9uHu3FKGvOBS8adY7wUhy1D4JUsGCtqmQjgLUoTHDqbyLRv6TgQ4V2FaLR9S3ZPFfzfxZt05ZopwR-sabs6JaN2Ft01l_dQgNFvhHHUAf9NvZ_3h7fPwiseLfuUYE-TWynkzJkGlDaRmgin8MvlyfOmb0Rfi1puqCnKqtztClYVm7Fhiu_rSrF6t-tFeSDW9dd-L-hwrdS-q6qNbjjjgpUF42Jf8GJ7pYJ1e1b0pSr31AvYMZqkNltj1ild5Y0OYaGmFHxXbozsyIT8ZnBu6TvmQ-A8PSG-ST4v3TIE2DGjQww_o0QdDTVtlsbVOxvJ9tjeFXGr2dlf9fR9JPvQL5Tsk-tWsoeqN4s3zW-Pko7j0m2Vm4BfEpL752X27hupCPyS8Qfgl1zf3wEAAP__Fl-KSA">