<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61095>61095</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
libc++ std::variant adds two words of overhead, rather than one, on Windows
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
davidben
</td>
</tr>
</table>
<pre>
I don't have an easy standalone reproducer, mostly because I don't see clang-cl on godbolt or anything, but here's a static_assert in Chromium:
https://chromium-review.googlesource.com/c/chromium/src/+/4294508
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8787813272405926289/+/u/compile__with_patch_/stdout
While `absl::variant<size_t, char>` is 16 bytes as expected, `std::variant<size_t, char>`, on just Windows is 24 bytes.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMUkmOwzYQfA11adigqM066DBLDOQFczS4tEVOaNJgk3ac1wfUOJlMkEMuEnqp6lKpJJFbA-LChlc2vDeyZBvTYuTNGYWhUdE8ll_BxMDElMHKG4IMgJIeQFkGI30MCAmvKZqiMTHxBpdI2T9AoZaFEL7hhAjay7DutIcYYI1GRZ8hJpDhka0La8WrksFiQiYmAlnvZKdPkghTBhfgzaZ4ceXCuhfG3xl_sTlfqVbiyMRRP8e7hDeH9_0a4-qRYkka9zpe6so_1pg4UtIb9JWJYy_mfuCH_yL2caX9X7B9TOuz95NMFeeNKvo3zHWQdj8bh-kwHdpOTKLnwyxGcZj_vl0qIF6uzuPpdHfZnq4ya3uqErOJJX-p-np-WOcR2MilIl81di83mZwMmXVv5P7AU65maisT635hIwdH0I6gHhkJJAH-fkWd0dQtNnLK5v-w1CoG-CyU4cMFE-9UiUX_RbxvzNKZuZtlg0s7TtN4GNt2auzSDtjOs-rMGcWolDgLjePQD_I8D8OI2LhFcNHxjrftMAzttFczR9PqSSjT8wkF6zlepPN772-b_40jKriMLZ-HxkuFnrYgCxHwDtuQCVFznZaK2amyEuu5d5TpmyW77HHxTuntN7zCv60AaQxBvke4x2QI4hniDZNFuZmXZLaYIFsZIAZ8OvQ0pynJLz9ztLpsi3pGsap4vnbXFD9R15Rs2muwtm_7MwAA__-BvS2t">