<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63497>63497</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang frontend C++ crash when using std::numeric_limits without header
</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/9qr5s5n4d (assertion-trunk)
```cpp
#include <iostream>
using E = std::numeric_limits<int>;
auto fail(E e) -> decltype(throw e, void()) {
throw e;
}
int main(){
return 0;
}
```
Compiling the above code crashes clang `clang++ -x c++ --std=c++20 `, crashes locally using clang-17.0 (a10019a), also on trunk with assertion (see godbolt link)
Note that if we use the correct header for std::numeric_limits (i.e. `#include <limits>`) then the code successfully compiles.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0U83SozYQfBpxmTIlBAbrwOHz3zGn3FNCGkBZIXn1Y8d5-pQw3nUl2SqXEUjdM92tESHoySL2ZH8k-3MhUpyd7wefojBB3MWExeDUs__dwfek5TfzBI8371SSSOovmGO8BVJ_EXYl7DpJWU5ODc7E0vmJsOvfhF35d78Pe9soIOwgQkAftbO76JP9Rhgn9Ezo1_bf0tdP3m7bF1ZrK01SCKQ-aReiR7GQ-vIJS0HbCS5A6jOEqHI_9ZdNC3ot_zB60TFksI0ZVx8_oSJFB6PQhrDDBZAwDjtSX0ChNPF5Q8IOcfbukbdOcHdaEXbIXTMOpNuoAN5nfpB3588q2kZYhLYb9icOwGNM3gL9H-jbjE-mk1tu2mS5cUYQg7sjSKcQpBdhxgDSCDtBtjAvCDsSdoTdXyDfy93q0Hl7ZzSfzdreBMZJYcwTXqauLLuqK-maXkVpxcWq_wTCBAfOwpokPHSc4Ue8-XRAhO06gNH_Cfs3FxHiLCLoER4IKeAqSjrvUUaYUSj0MDr_q1BzEV1i-ZLweVHeoV_WHZ557UauEEKSEkMYU9YpV0cxlFCovla85qLAvmoPXdu0bUOLue-Earuha0Q9ig65FJxXbKz2bUcPvFaq0D2jrKYtaxhrGkrLser2OKAcO855xQfSUFyENqUx9yXPRqFDSNi3dcO7wogBTViHkDGLD1g3CWN5Jn2fMbshTYE01OgQw0-WqKPB_rRmPnpnI1oFpy3qNVF4ZOmvMH9lY47OpbfjRfKm_9dg6zinoZRuIeyai2-P3c27P1FGwq5ry4Gw6yrpnwAAAP__VtFVUQ">