<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/106379>106379</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang times out compiling simple program. GCC ok.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
socketpair
</td>
</tr>
</table>
<pre>
https://godbolt.org/z/P7K1MTrcb
```cpp
#include <algorithm>
#include <array>
#include <ranges>
#include <string>
#include <vector>
using namespace std;
namespace {
consteval string gen() { return "xxx"; }
class qwe {
public:
consteval qwe(const string& str) : s(str.size()) { str.copy(x.data(), s); }
constexpr operator const vector<char>() const {
return {x.cbegin(), x.cbegin() + s};
}
private:
// 1048576 is a clang limit
array<char, 1048576> x{};
size_t s;
};
} // namespace
int fun1() {
const vector<char> v2{qwe(gen())};
return v2.size();
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VE1zqzgQ_DXDZSoUDDaIA4fYjvewtVV72PuWEDLWi0BEEo6TX_-KDxucl7gojKZH063WSNw5VbdSFrDdwfYQ8N6fjS2cEa_Sd1zZoDTVR3H2vnOQPAMdgY61qUqjfWhsDXT8BDr-m_0d__OfFSVEB4ie53caTY_oujlCiWqF7iuJkOy5ro1V_txA8vItbi3_-AGzvK2l-wF03qq2_gG8SOGNXcDx3TvV1tjyRrqOC4nOV5Ds1hkLBtkMCNM6Ly9c40SItWyBGFA-5KCVvrctAtH1egUiSHYI2WGeq7lz-Pa-KoddX2olBpenMSIuFG_vEoiN45kOKB2-RrrkGR0Qc96GTn3KScVNyBAVpvsAYtew4p7f4P0wKX_QtZBeO4umk5Z7Y6cQ3qzbizMfHZwWO4HLOubfbf3Z7hqKUtaqXXgfIwi0QzdoSFY17ppu9lh14V4--DP1I8bRhm2zFJVDjkLztkatGuWXxLmXJuW0v82A5AWvg_Iv3IOJ_3t0SxOsEu6RO_-9OdYJqvV46tt4aYm5_vdm4oUg203bfG-k4fmDeWXuhdb7vRb7eAKDqkiqPMl5IIs4ow3bZNvtNjgXIqc8j9KM8zLPUsYizgTPWVol8SmR7BSogiLaRIxYTHEexyGrGCfGcypPPNpUKWwi2XClQ60vzXAlBMq5XhZxlCZZHmheSu3G64Vo3JrhKGwPgS2GCU9lXzvYRFo575YSXnkti_24k1410qHpPQrTdEoPJ82pptMSO2tqy5sQ_9rv0byGQW_117tK-XNfhsI0QMeh_vz31FnzSwoPdBz1OqDjLPlS0O8AAAD__88_daE">