<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/88714>88714</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
lld/ELF/Symbols.h: 2 * copying std:atomic
</td>
</tr>
<tr>
<th>Labels</th>
<td>
lld
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dcb314
</td>
</tr>
</table>
<pre>
Static analyser cppcheck says:
1.
lld/ELF/Symbols.h:89:29: error: Using 'memcpy' on class that contains a 'std::atomic'. [memsetClass]
Source code is
Symbol(const Symbol &o) { memcpy(this, &o, sizeof(o)); }
but https://en.cppreference.com/w/cpp/atomic/atomic says
std::atomic is neither copyable nor movable.
2.
lld/ELF/Symbols.h:553:3: error: Using 'memset' on class that contains a 'std::atomic'. [memsetClass]
Same thing again.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysU8GOmzAQ_ZrhMloEY7PAgUOyW069Rf0AYybBrcHINlulX185YdVspZV6qITMWJ7xe_OeR4VgLgtzB9URqtdMbXFyvhv1IEqZDW68dqeootGoFmWvgT3qddUT6x8Y1DWAOEDxCsW-lvnjztoRqP_ytQfqT9d5cDbkE4hD04I4UFqQvXc-Bd-CWS4IVM886_UKVKNbUFsVAsZJRdRuicosAVXKCnFM0OKgopuNBqpzhOo48xw4vqQqqF4fuZzc5jWjdiOjCY8niHduQI12S4j7FoGeHVCLUB_xnVQTJxOAXvbDFwzmF7szUJNS0yeOCPUH5GGLOMW43rSipAUvuV5Xz2f2vGjOtZuB-p9AvV5XoP69pz24C_1w41_Nowm4sIlTMsetVzVYxsV5nN1binN8LKZ_sqiqBIiD-NSiwPH_W6RmxjglEHVRZtmJZmMnxla0KuOurEtRNiU1dTZ141m2ohE8yKqSJAY1jPos1fm5KpSWSmamo4JkIcuqLGVJdV6q57ZVZSM1D-lKkAXPytjc2rc5d_6SmRA27pqmLmVm1cA23CaD6CYUpRHxXcp-GrZLAFlYE2L4Ux9NtNx9pioSAh1uJqUu7wrd5ck2b7uPz-Ri4rQN--tICPvvafXuO-sI1N_oBqD-xvh3AAAA__-AvyaP">