<div dir="ltr"><div><br></div><div><div><div>Most users have a new Clang compiler, but still specify C++03. Old compilers aren't the problem,<br></div><div><div>and our tolerance for C++03 must match Clang. Thankfully Clang provides much of C++11 as an extension;</div><div>including _Atomic.. GCC is  much stricter and problematic. Currently 75% of libc++'s C++03 tests fail with GCC.</div></div><div><br></div><div><div>The greatest benefactor of the Clang and libc++'s C++11 extensions is  libc++. We use `unique_ptr` to write</div><div>exception safe code in `vector` and `map`. We *require* C++11 reference collapsing, and we exploit `decltype`,</div><div> `nullptr`, and variadic templates being available as extensions. All to avoid C++03 shortcomings.</div></div><div></div><div><br></div><div>We should plan for the day we drop C++03 support entirely. We shouldn't create a conforming C++03 mode</div><div>15 years later. </div></div><div><br></div><div>How much of the initial problem is mitigated if you assume the host compiler is a modern Clang?</div><div><br></div><div>/Eric</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 11, 2019 at 3:48 PM James Y Knight via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org">libcxx-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="auto"><div dir="ltr">IMO, Libc++ in C++03 is pretty weird in general -- it's odd that it tries to provide c++11 stdlib features in c++98/03 modes. That's certainly been the intended design from the beginning, but I'm not sure how useful it actually is or ever has been. I've personally found it both surprising and annoying, back when I actually used to care about pre-c++11 at all. :)</div><div dir="ltr"><br></div><div dir="ltr"><div>For example, a unique_ptr class is provided even pre-c++11. But, as soon as you try to do just about anything with it, it becomes clear that it doesn't (can't!) actually work as it should.</div><div><br></div><div>Or, std::promise and std::future are provided, but without move constructors, can you actually use it? Is there really even a point?</div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 6, 2019 at 2:21 PM JF Bastien via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org" rel="noreferrer" target="_blank">libcxx-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Doing atomics before 11 was pretty wild… So I understand that people using an old C++ want some nice atomics. At the same time… They really should update to C++11 or later.<div><br></div><div>What does libc++ try to do with new library features on old languages? Seems easy enough so support most of say optional or variant (without CTAD) before C++17. Is this done consistently? And how far back, do we even try to support C++98?<div><br></div><div>It seems like we can be nice where it’s easy, but at some point in time are we just supporting stuff nobody cares about?</div><div><br><div><br><blockquote type="cite"><div>On Feb 5, 2019, at 9:33 PM, Olivier Giroux via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org" rel="noreferrer" target="_blank">libcxx-dev@lists.llvm.org</a>> wrote:</div><br class="gmail-m_3905774726522412782gmail-m_4837989082579054605m_3423585960860593753gmail-m_3475481270181278667Apple-interchange-newline"><div><div class="gmail-m_3905774726522412782gmail-m_4837989082579054605m_3423585960860593753gmail-m_3475481270181278667WordSection1" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">Sorry, that quote is from my patch, but there’s identical code elsewhere in the file. I swear!<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">Olivier<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><u></u> <u></u></span></div><div style="border-style:solid none none;border-top-width:1pt;border-top-color:rgb(181,196,223);padding:3pt 0in 0in"><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><b><span>From:<span class="gmail-m_3905774726522412782gmail-m_4837989082579054605m_3423585960860593753gmail-m_3475481270181278667Apple-converted-space"> </span></span></b><span>libcxx-dev <<a href="mailto:libcxx-dev-bounces@lists.llvm.org" rel="noreferrer" target="_blank">libcxx-dev-bounces@lists.llvm.org</a>> on behalf of Olivier Giroux via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org" rel="noreferrer" target="_blank">libcxx-dev@lists.llvm.org</a>><br><b>Reply-To:<span class="gmail-m_3905774726522412782gmail-m_4837989082579054605m_3423585960860593753gmail-m_3475481270181278667Apple-converted-space"> </span></b>Olivier Giroux <<a href="mailto:OGiroux@nvidia.com" rel="noreferrer" target="_blank">OGiroux@nvidia.com</a>><br><b>Date:<span class="gmail-m_3905774726522412782gmail-m_4837989082579054605m_3423585960860593753gmail-m_3475481270181278667Apple-converted-space"> </span></b>Tuesday, February 5, 2019 at 9:33 PM<br><b>To:<span class="gmail-m_3905774726522412782gmail-m_4837989082579054605m_3423585960860593753gmail-m_3475481270181278667Apple-converted-space"> </span></b>"<a href="mailto:libcxx-dev@lists.llvm.org" rel="noreferrer" target="_blank">libcxx-dev@lists.llvm.org</a>" <<a href="mailto:libcxx-dev@lists.llvm.org" rel="noreferrer" target="_blank">libcxx-dev@lists.llvm.org</a>><br><b>Subject:<span class="gmail-m_3905774726522412782gmail-m_4837989082579054605m_3423585960860593753gmail-m_3475481270181278667Apple-converted-space"> </span></b>[libcxx-dev] What C++03 support should <atomic> have?<u></u><u></u></span></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><u></u> <u></u></span></div></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">There is a little bit of code in this file that suggests it once worked in C++03.</span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> </span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">Like so:</span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif;line-height:13.5pt;background-color:rgb(30,30,30)"><span style="font-size:10pt;font-family:Consolas;color:rgb(197,134,192)">#ifndef</span><span style="font-size:10pt;font-family:Consolas;color:rgb(86,156,214)"><span class="gmail-m_3905774726522412782gmail-m_4837989082579054605m_3423585960860593753gmail-m_3475481270181278667Apple-converted-space"> </span></span><span style="font-size:10pt;font-family:Consolas;color:rgb(220,220,170)">_LIBCPP_CXX03_LANG</span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif;line-height:13.5pt;background-color:rgb(30,30,30)"><span style="font-size:10pt;font-family:Consolas;color:rgb(212,212,212)">   <span class="gmail-m_3905774726522412782gmail-m_4837989082579054605m_3423585960860593753gmail-m_3475481270181278667Apple-converted-space"> </span></span><span style="font-size:10pt;font-family:Consolas;color:rgb(220,220,170)">__cxx_atomic_type</span><span style="font-size:10pt;font-family:Consolas;color:rgb(212,212,212)">() _NOEXCEPT =<span class="gmail-m_3905774726522412782gmail-m_4837989082579054605m_3423585960860593753gmail-m_3475481270181278667Apple-converted-space"> </span></span><span style="font-size:10pt;font-family:Consolas;color:rgb(197,134,192)">default</span><span style="font-size:10pt;font-family:Consolas;color:rgb(212,212,212)">;</span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif;line-height:13.5pt;background-color:rgb(30,30,30)"><span style="font-size:10pt;font-family:Consolas;color:rgb(197,134,192)">#else</span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif;line-height:13.5pt;background-color:rgb(30,30,30)"><span style="font-size:10pt;font-family:Consolas;color:rgb(212,212,212)">   <span class="gmail-m_3905774726522412782gmail-m_4837989082579054605m_3423585960860593753gmail-m_3475481270181278667Apple-converted-space"> </span></span><span style="font-size:10pt;font-family:Consolas;color:rgb(220,220,170)">__cxx_atomic_type</span><span style="font-size:10pt;font-family:Consolas;color:rgb(212,212,212)">() _NOEXCEPT :<span class="gmail-m_3905774726522412782gmail-m_4837989082579054605m_3423585960860593753gmail-m_3475481270181278667Apple-converted-space"> </span></span><span style="font-size:10pt;font-family:Consolas;color:rgb(220,220,170)">__a_value</span><span style="font-size:10pt;font-family:Consolas;color:rgb(212,212,212)">() {}</span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif;line-height:13.5pt;background-color:rgb(30,30,30)"><span style="font-size:10pt;font-family:Consolas;color:rgb(197,134,192)">#endif</span><span style="font-size:10pt;font-family:Consolas;color:rgb(212,212,212)"><span class="gmail-m_3905774726522412782gmail-m_4837989082579054605m_3423585960860593753gmail-m_3475481270181278667Apple-converted-space"> </span></span><span style="font-size:10pt;font-family:Consolas;color:rgb(106,153,85)">// _LIBCPP_CXX03_LANG</span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> </span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">Is that an actual design goal? It looks like it’s broken right now.</span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> </span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">Do we maintain this, or do we bump the assumed default to C++11?</span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> </span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">Thanks for your guidance,</span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> </span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">Olivier</span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"> </span><u></u><u></u></div><div><div class="MsoNormal" align="center" style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif;text-align:center"><span style="font-size:11pt"><hr size="0" width="100%" align="center"></span></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">This email message is for the sole use of the intended recipient(s) and may contain confidential information.  Any unauthorized review, use, disclosure or distribution is prohibited.  If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.<u></u><u></u></span></div></div><div><div class="MsoNormal" align="center" style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif;text-align:center"><span style="font-size:11pt"><hr size="0" width="100%" align="center"></span></div></div></div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">_______________________________________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">libcxx-dev mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"><a href="mailto:libcxx-dev@lists.llvm.org" rel="noreferrer" target="_blank">libcxx-dev@lists.llvm.org</a></span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev</a></span></div></blockquote></div><br></div></div></div>_______________________________________________<br>
libcxx-dev mailing list<br>
<a href="mailto:libcxx-dev@lists.llvm.org" rel="noreferrer" target="_blank">libcxx-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev" rel="noreferrer noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev</a><br>
</blockquote></div>
_______________________________________________<br>
libcxx-dev mailing list<br>
<a href="mailto:libcxx-dev@lists.llvm.org" target="_blank">libcxx-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev</a><br>
</blockquote></div>