<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 20 Jun 2023, 06:10 Jeremy Hurwitz via Std-Proposals, &lt;<a href="mailto:std-proposals@lists.isocpp.org">std-proposals@lists.isocpp.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt; Is this a defect in the current spec? Thanks!<br>
<br>
Since C++17, std::atomic value-initializes its contained value, see:<br>
<br>
<a href="http://eel.is/c++draft/atomics#types.operations-2" rel="noreferrer noreferrer" target="_blank">http://eel.is/c++draft/atomics#types.operations-2</a><br>
<br>
Therefore it cannot be trivially-constructible. std::atomic&lt;bool&gt; is not<br>
special in this regard.<br></blockquote><div><br></div><div>Good catch. Verified via godbolt that `std::is_trivially_constructible_v&lt;std::atomic&lt;bool&gt;&gt;` is true in C++17 and false in C++20. So that defect only applies to C++17 and before.</div><div><br></div><div>Looks like the trivially-destructible part still applies in C++20.</div></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Please see <a href="https://cplusplus.github.io/LWG/lwg-active.html#submit_issue">https://cplusplus.github.io/LWG/lwg-active.html#submit_issue</a> for how to submit a library issue, thanks!</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div></div>

