<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54983>54983</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang++ endless loop / stack growth
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
fiesh
</td>
</tr>
</table>
<pre>
The following code makes `clang++` run endlessly until resource exhaustion from 13 on. <= 12 works.
```cpp
extern "C" void *memcpy(void *, void *, long);
struct Utf32String {
void operator=(const Utf32String &that) {
if (this != &that) {
_data = new char32_t[_length]();
_length = that._length;
memcpy(_data, that._data, sizeof(char32_t) * _length);
}
}
long _length;
char32_t *_data;
};
struct InputBuffer {
Utf32String _hint;
int handle_hints();
};
int InputBuffer::handle_hints() {
_hint = Utf32String();
return 0;
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1U8GO2yAQ_Rp8GdWyIXHigw_JriL13PYcETw2dAlYgDe7_fqCvW69iVYiMTAz7z0ew8W2781PidBZre1NmR6EbRGu_AU9kKoQmpue0GMaVQFuNICm1ei9fofRBKXBobejEwj4Jvnog7IGOmevUDKwJgcg7ImwZygp3Kx78Tkpnklx-PivinmIYZh38C2gM0AofYo_eLWqjYvDFa9ieCd0v2wQ-gTrubZJaE3YccbxwY0iwK_QMfojuHQ0svuIwVxpB3Q8WBfVRWBhjb_Lp1WQPETUdSmA6mJoH6SKFtEyne2rTIBzywOHlGPwBkJyx-g5kO3xrNH0QZJt4l4L_6ibw1Nlgs6X_M9p_2yZeJIPc_Ky8uoP2i6dbmFOEulhwb8nJrvnZbGaJm_hUcCCmQBnxiWWau8u4rsZxnAcuw7d2qO132epTFjhxxVIntptivg7o9YkKXXFQNghjsfaNfO0P_m70vBwFw7DGNux-MT6uXWztmFtzWqeBRU0Nqs3szyW6KAdok0n8IGLF-idvQWZjU43MoTBJ730FEevghwvubDXuND6dfl8G5z9jSJe30l5P2I8z2m7qfcsk80eLxUreFuUBa3KqiyYqLcd7fBSb4XYYab5BbVvYtPFF5XacIKI89h8mWpoQWmxKeuyZmVJ8_2-pRvWCdHteF1uGNkUeOVK50lHbl2fuWaSdBl7H4Na-eD_B7n3qjeIE13E52OQ1jWdQi-zibiZhP8FOYhRMw">