<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000'><br><hr id="zwchr"><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Richard Smith via cfe-commits" <cfe-commits@lists.llvm.org><br><b>To: </b>"cfe-commits" <cfe-commits@lists.llvm.org>, "Clang Dev" <cfe-dev@lists.llvm.org><br><b>Sent: </b>Wednesday, June 29, 2016 2:09:37 PM<br><b>Subject: </b>RFC: Default language standard mode policy<br><br><div dir="ltr"><div>Hi all!<br></div><div><br></div><div>I'd like to establish a policy for Clang's default language standard (if none is specified with -std), as follows:</div><div><br></div><div>  Clang defaults to the most recent published standard for the selected language that it fully implements.</div><div><br></div><div id="DWT13344">The practical impact of this is that clang++ will default to C++14 for C++ compilations (for version 3.9 onwards) and will default to C++17 once our implementation support is complete and the standard is published (whichever happens later).</div></div></blockquote>I think that we need to include libc++ in this criteria as well. I think we'll also need some CMake flags to adjust the default for builds for systems on which this won't work.<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div dir="ltr"><div></div><div><br></div><div>I'd suggest that we apply the same policy for clang-cl, but if it's important that we enable a not-yet-fully-implemented standard for cl compatibility, that seems reasonable.</div><div><br></div><div id="DWT13371">The question of whether the default mode for the GCC-compatible driver should be -std=gnuXXX or -std=cXXX is separate, but also likely worth discussing. Enabling GNU keywords by default is a very odd choice, and if we believe we can change our defaults without breaking the world then this seems like a good time to do so.</div></div></blockquote>Unfortunately, on many systems, some standard system headers won't even parse without GNU extensions enabled. I think we'll need to leave the GNU extensions on by default (at least for parsing system headers).<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div dir="ltr"><div></div><div><br></div><div id="DWT13372">I also intend to make explicit in our documentation that our -std=XXX flag enables the selected standard, *plus all relevant issues in Defect Report status from the relevant language committee* (it doesn't make sense to support a language without its bugfixes).</div></div></blockquote>+1<br><br> -Hal<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div dir="ltr"><div></div><div><br></div><div>Thoughts?</div></div>
<br>_______________________________________________<br>cfe-commits mailing list<br>cfe-commits@lists.llvm.org<br>http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits<br></blockquote><br><br><br>-- <br><div><span name="x"></span>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory<span name="x"></span><br></div></div></body></html>