RFC: Default language standard mode policy

Robinson, Paul via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 29 21:31:38 PDT 2016


What Warren said.  We've been carrying the private patch for 4 years or so, and now that we're getting the test changes upstream it will be progressively less of a problem for us.  (And thanks Sean for actually trying it on a couple of titles!  You read my mind.)

I also wanted to add that I agree with Hal, it would be weird for the compiler and library to be defaulting to different dialects, particularly when their features are defined in the same document.  But that's something of an abstract point; PS4 isn't using either libc++ or libstdc++ which are the primary libraries that Clang should care about, so we'll probably continue having our own target-specific default anyway.
--paulr

From: Ristow, Warren
Sent: Wednesday, June 29, 2016 6:07 PM
To: Sean Silva; Richard Smith
Cc: cfe-commits; Clang Dev; Robinson, Paul
Subject: RE: RFC: Default language standard mode policy

Hi all,

>
> It may be feasible for us to use a "-std=gnu++latest" behavior and not have
> to have a PS4-specific default; CC'ing Warren and Paul.

As Sean pointed out, he did some tests and found we'd need to enable the GNU
keywords on PS4.  Having a PS4-specific patch for this wouldn't be a problem
for us, though.  So if the related issues mentioned in this thread for other
platforms (e.g., standard system headers needing GNU extensions enabled just
to parse them without error) are easily resolved, and so the default behavior
becomes to disable GNU keywords, it's easy enough for us to enable what we
need in this area for PS4.

>> Note that at this point I'd like to mainly focus on what our policy should
>> be; there are certainly technical challenges involved in actually applying
>> the policy (another one is that clang's test suite still has some failures
>> when the default is changed, but Charles Li has made tremendous headway on
>> this), and if we can't actually prepare for the transition in the C++
>> default in time for 3.9, then so be it.

Internally on PS4, we default to C++11.  FTR, the biggest issues we've had
on that point (by far) were clang's tests.  That's much less of a headache
today, due to Charles' work on this, but as you said, some failures remain.
I'd expect those could be dealt with in time for 3.9 without too much
difficulty if there was a strong desire to change the default that quickly.

That said, independent of what default is selected at 3.9, for PS4 we will
most likely prefer to stay with our current default (gnu++11) at 3.9.  We'll
revisit switching to 14 later, and consider future language dialect changes on
a case by case basis.

-Warren Ristow

From: Sean Silva [mailto:chisophugis at gmail.com]
Sent: Wednesday, June 29, 2016 1:35 PM
To: Richard Smith
Cc: cfe-commits; Clang Dev; Ristow, Warren; Robinson, Paul
Subject: Re: RFC: Default language standard mode policy



On Wed, Jun 29, 2016 at 1:34 PM, Sean Silva <chisophugis at gmail.com<mailto:chisophugis at gmail.com>> wrote:


On Wed, Jun 29, 2016 at 12:51 PM, Richard Smith <richard at metafoo.co.uk<mailto:richard at metafoo.co.uk>> wrote:
On Wed, Jun 29, 2016 at 12:30 PM, Sean Silva <chisophugis at gmail.com<mailto:chisophugis at gmail.com>> wrote:


On Wed, Jun 29, 2016 at 12:09 PM, Richard Smith via cfe-commits <cfe-commits at lists.llvm.org<mailto:cfe-commits at lists.llvm.org>> wrote:
Hi all!

I'd like to establish a policy for Clang's default language standard (if none is specified with -std), as follows:

  Clang defaults to the most recent published standard for the selected language that it fully implements.

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).

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.

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.

Using cXXX instead of gnuXXX would break the world on PS4. So for sure with `-std=c++latest` we would end up proposing a patch to change this for the PS4 target to gnu++latest (or gnu++11 if gnu++latest is not feasible).

OK. Out of interest, is it the GNU keywords that you need, or some other effect of the difference between modes?

A quick check of two titles I have at hand shows that at least `typeof` is in use.

(this check consisted of using -std=c++11 instead of -std=gnu++11 and seeing what breaks)

-- Sean Silva


-- Sean Silva


(As I'm sure you're aware, we have pending to upstream a patch that makes -std=gnu++11 the default C++ language mode on PS4 (just blocked on fixing tests to not assume the existing std)).

It may be feasible for us to use a "-std=gnu++latest" behavior and not have to have a PS4-specific default; CC'ing Warren and Paul.

-- Sean Silva


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).

Thoughts?

_______________________________________________
cfe-commits mailing list
cfe-commits at lists.llvm.org<mailto:cfe-commits at lists.llvm.org>
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160630/d9501579/attachment-0001.html>


More information about the cfe-commits mailing list