<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/94816>94816</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang] The datasize of empty types is wrong
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:frontend
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
philnik777
</td>
</tr>
</table>
<pre>
With both `__datasizeof` and `-Xclang -fdump-record-layouts` Clang claims that the datasize of `struct Empty {};` is one, but the ABI behaves as-if it is zero, since it happily uses the single byte when using `[[no_unique_address]]` or EBO that a regular `Empty` would occupy.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxckkGL2z4QxT-NfBkcZDm244MPm80G_qf_pdDegmRNLLWK5GqkXbyfvshpKRQMhtF7T4_5SRLZxSNOrDuz7lLJnEyI02qs8_bHMAyVCnqbvtpkQIVkgPX8dtMySbKfGO6s5yC9LuP62-ykX6C-6_xY64hziLp2cgs5UdG97sezk_ZBkIxMkAzCnywI95JCKeY5wdtjTRuw4cyGC2vPxW4JgkcmXkHlp_Xl_B8oNPIdCSTV9g42FdknxlB0ZP2MZWbkulq3QSak3UnWLw5BbQnhw6CHXCbl_n0PZx9u2dufGW9S64hErLuUr-cQIryd_3_2lxBxyU7G4twrF8VHyE5DmOe8bodKT60e21FWODVDM5x4y_uuMtMJRxyb-3Ecetlij1I2YkbV8abvhO77yk6CiyPv-SDatuHdYeTq1JwUCj6edKuO7MjxIa07OPf-OIS4VJYo4zQeT01fOanQ0c5ViJ0Ma1_uMfiEXjMhCu04FWut8kLsyJ2lRH_Dkk1ufxc7N9Zd4Ms_uHCHlLYVqaz9Iwa_VDm6yaS0EmtfmLgycV1sMlkd5vBg4lrif__qNYbvOCcmrntxYuL67P4-iV8BAAD__5p_1-g">