<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Feb 12, 2019, at 01:14, Eric Fiselier via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org" class="">libcxx-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class=""><div class=""><div class="">Most users have a new Clang compiler, but still specify C++03. Old compilers aren't the problem,<br class=""></div><div class=""><div class="">and our tolerance for C++03 must match Clang. Thankfully Clang provides much of C++11 as an extension;</div><div class="">including _Atomic.. GCC is much stricter and problematic. Currently 75% of libc++'s C++03 tests fail with GCC.</div></div><div class=""><br class=""></div><div class=""><div class="">The greatest benefactor of the Clang and libc++'s C++11 extensions is libc++. We use `unique_ptr` to write</div><div class="">exception safe code in `vector` and `map`. We *require* C++11 reference collapsing, and we exploit `decltype`,</div><div class=""> `nullptr`, and variadic templates being available as extensions. All to avoid C++03 shortcomings.</div></div></div></div></div></div></blockquote><div><br class=""></div><div>I agree that C++11 extensions in the COMPILER are useful, but extensions in the LIBRARY are not. We could use our own internal <font face="Monaco" class="">__unique_ptr</font> type instead, that wouldn't be a problem.</div><div><br class=""></div><div>In fact, I think most of the time it's a disservice to libc++ because we can't provide good support for those C++11 extensions, and that's a source of confusion and bugs. Also, it sometimes happens that simply providing the extension makes us non-conforming, as is the case for <font face="Monaco" class="">std::string_view</font>.</div><div><br class=""></div><div>You already know that, but I'm really not a big fan of extensions.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""></div><div class="">We should plan for the day we drop C++03 support entirely. We shouldn't create a conforming C++03 mode</div><div class="">15 years later. </div></div><div class=""><br class=""></div><div class="">How much of the initial problem is mitigated if you assume the host compiler is a modern Clang?</div></div></div></div></blockquote><div><br class=""></div><div>Even a modern Clang does not support lambdas in C++03 mode:</div><div><br class=""></div><div><font face="Monaco" class="">$ echo 'int main() { [](int x) { }; }' | clang++ -xc++ - -std=c++03</font></div><div><br class=""></div><div>It therefore doesn't make our life easier in this specific case.</div><div><br class=""></div><div>Louis</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class=""><br class=""></div><div class="">/Eric</div></div></div><br class=""><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" class="">libcxx-dev@lists.llvm.org</a>> wrote:<br class=""></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" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="auto" class=""><div dir="ltr" class="">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" class=""><br class=""></div><div dir="ltr" class=""><div class="">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 class=""><br class=""></div><div class="">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 class=""><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" class="">libcxx-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="">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 class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">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 class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">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" class="">libcxx-dev@lists.llvm.org</a>> wrote:</div><br class="gmail-m_3905774726522412782gmail-m_4837989082579054605m_3423585960860593753gmail-m_3475481270181278667Apple-interchange-newline"><div class=""><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" class=""><span style="font-size:11pt" class="">Sorry, that quote is from my patch, but there’s identical code elsewhere in the file. I swear!<u class=""></u><u class=""></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><span style="font-size:11pt" class=""><u class=""></u> <u class=""></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><span style="font-size:11pt" class="">Olivier<u class=""></u><u class=""></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><span style="font-size:11pt" class=""><u class=""></u> <u class=""></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" class=""><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><b class=""><span class="">From:<span class="gmail-m_3905774726522412782gmail-m_4837989082579054605m_3423585960860593753gmail-m_3475481270181278667Apple-converted-space"> </span></span></b><span class="">libcxx-dev <<a href="mailto:libcxx-dev-bounces@lists.llvm.org" rel="noreferrer" target="_blank" class="">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" class="">libcxx-dev@lists.llvm.org</a>><br class=""><b class="">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" class="">OGiroux@nvidia.com</a>><br class=""><b class="">Date:<span class="gmail-m_3905774726522412782gmail-m_4837989082579054605m_3423585960860593753gmail-m_3475481270181278667Apple-converted-space"> </span></b>Tuesday, February 5, 2019 at 9:33 PM<br class=""><b class="">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" class="">libcxx-dev@lists.llvm.org</a>" <<a href="mailto:libcxx-dev@lists.llvm.org" rel="noreferrer" target="_blank" class="">libcxx-dev@lists.llvm.org</a>><br class=""><b class="">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 class=""></u><u class=""></u></span></div></div><div class=""><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><span style="font-size:11pt" class=""><u class=""></u> <u class=""></u></span></div></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><span style="font-size:11pt" class="">There is a little bit of code in this file that suggests it once worked in C++03.</span><u class=""></u><u class=""></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><span style="font-size:11pt" class=""> </span><u class=""></u><u class=""></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><span style="font-size:11pt" class="">Like so:</span><u class=""></u><u class=""></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)" class=""><span style="font-size:10pt;font-family:Consolas;color:rgb(197,134,192)" class="">#ifndef</span><span style="font-size:10pt;font-family:Consolas;color:rgb(86,156,214)" class=""><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)" class="">_LIBCPP_CXX03_LANG</span><u class=""></u><u class=""></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)" class=""><span style="font-size:10pt;font-family:Consolas;color:rgb(212,212,212)" class=""> <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)" class="">__cxx_atomic_type</span><span style="font-size:10pt;font-family:Consolas;color:rgb(212,212,212)" class="">() _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)" class="">default</span><span style="font-size:10pt;font-family:Consolas;color:rgb(212,212,212)" class="">;</span><u class=""></u><u class=""></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)" class=""><span style="font-size:10pt;font-family:Consolas;color:rgb(197,134,192)" class="">#else</span><u class=""></u><u class=""></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)" class=""><span style="font-size:10pt;font-family:Consolas;color:rgb(212,212,212)" class=""> <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)" class="">__cxx_atomic_type</span><span style="font-size:10pt;font-family:Consolas;color:rgb(212,212,212)" class="">() _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)" class="">__a_value</span><span style="font-size:10pt;font-family:Consolas;color:rgb(212,212,212)" class="">() {}</span><u class=""></u><u class=""></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)" class=""><span style="font-size:10pt;font-family:Consolas;color:rgb(197,134,192)" class="">#endif</span><span style="font-size:10pt;font-family:Consolas;color:rgb(212,212,212)" class=""><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)" class="">// _LIBCPP_CXX03_LANG</span><u class=""></u><u class=""></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><span style="font-size:11pt" class=""> </span><u class=""></u><u class=""></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><span style="font-size:11pt" class="">Is that an actual design goal? It looks like it’s broken right now.</span><u class=""></u><u class=""></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><span style="font-size:11pt" class=""> </span><u class=""></u><u class=""></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><span style="font-size:11pt" class="">Do we maintain this, or do we bump the assumed default to C++11?</span><u class=""></u><u class=""></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><span style="font-size:11pt" class=""> </span><u class=""></u><u class=""></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><span style="font-size:11pt" class="">Thanks for your guidance,</span><u class=""></u><u class=""></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><span style="font-size:11pt" class=""> </span><u class=""></u><u class=""></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><span style="font-size:11pt" class="">Olivier</span><u class=""></u><u class=""></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><span style="font-size:11pt" class=""> </span><u class=""></u><u class=""></u></div><div class=""><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" class=""><hr size="0" width="100%" align="center" class=""></span></div></div><div class=""><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif" class=""><span style="font-size:11pt" class="">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 class=""></u><u class=""></u></span></div></div><div class=""><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" class=""><hr size="0" width="100%" align="center" class=""></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" class="">_______________________________________________</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" class=""><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" class="">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" class=""><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" class=""><a href="mailto:libcxx-dev@lists.llvm.org" rel="noreferrer" target="_blank" class="">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" class=""><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" class=""><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev</a></span></div></blockquote></div><br class=""></div></div></div>_______________________________________________<br class="">
libcxx-dev mailing list<br class="">
<a href="mailto:libcxx-dev@lists.llvm.org" rel="noreferrer" target="_blank" class="">libcxx-dev@lists.llvm.org</a><br class="">
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev" rel="noreferrer noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev</a><br class="">
</blockquote></div>
_______________________________________________<br class="">
libcxx-dev mailing list<br class="">
<a href="mailto:libcxx-dev@lists.llvm.org" target="_blank" class="">libcxx-dev@lists.llvm.org</a><br class="">
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev</a><br class="">
</blockquote></div>
_______________________________________________<br class="">libcxx-dev mailing list<br class=""><a href="mailto:libcxx-dev@lists.llvm.org" class="">libcxx-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev<br class=""></div></blockquote></div><br class=""></body></html>