[PATCH] Enable C++11

Alp Toker alp at nuanti.com
Mon Jan 6 11:44:43 PST 2014

On 06/01/2014 19:02, Chandler Carruth wrote:
> I think we need to do a bit more work here before submitting anything 
> like this. I had planned to do it,

I defer to you on the matter -- you've been on top of this so far. 
Indeed Arnaud pointed out that he had a more complete patch nested deep 
in the initial discussion so that may rather be the starting point.

The proposed patch can just be taken as a reminder that we're post-3.4 
and thinking about this seriously now. I think some developers are still 
using old compilers day to day.

> but if you want to do it, the minimum I think we should do first:
> - Document what versions of which compilers we're trying to support as 
> host compilers.
> - Add at least some checks to try to error early and clearly at 
> configure / cmake time on host compilers we don't really support (with 
> a flag to bypass this)

I focused on the CMake side, which does perform a check if the 
-std=c++11 flag is accepted, then tries fallback to -std=c++0x, and 
failing both emits an error. Do you think we'll need more than that in 
practice? It might be enough to use that and rely on Compiler.h for some 
period of time.

> - Get the build bots upgraded so that these changes don't cause the 
> bots to just die immediately -- there are several where it would.

Perhaps the easiest way is to land a "simple" version of the patch like 
what I posted and collect build server data before reverting. In the 
worst case it's a disruption for an hour or so, and best case the 
majority of builders may "just work".

> - Document the C++11 features which we think are supported by these 
> compilers (mostly MSVC restrictions I suspect)
> - Throw the switch in a way that folks can locally disable it for a while

That's a good idea.

> - Then make it permanent and expose C++1y

Yes :-)


> Does that make sense?
> On Mon, Jan 6, 2014 at 12:34 PM, Alp Toker <alp at nuanti.com 
> <mailto:alp at nuanti.com>> wrote:
>     The attached patch enables C++11 by default in the CMake and
>     Makefile build systems.
>     The old LLVM_ENABLE_CXX11 flag is retrofitted as LLVM_ENABLE_CXX1Y
>     for those looking to try the latest experimental standard.
>     The CMake changes include an additional fallback to -std=c++0x.
>     This fallback can hopefully be removed shortly when the remaining
>     legacy build servers are upgraded.
>     No changes made to the MSVC configuration in this patch. I'm
>     guessing Takumi will want to take care of that personally :-)
>     Alp.
>     -- 
>     http://www.nuanti.com
>     the browser experts
>     _______________________________________________
>     cfe-commits mailing list
>     cfe-commits at cs.uiuc.edu <mailto:cfe-commits at cs.uiuc.edu>
>     http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

the browser experts

More information about the cfe-commits mailing list