Can I use C++11 with Xcode?

c++, c++11, clang, gcc, xcode

Solution

Xcode 4.2 had finally added support for C++0X:

In the project build settings screen, switch on "All" options.

In the "Build Options" section, set compiler to "Apple LLVM compiler 3.0".

Scroll down to "Apple LLVM Compiler 3.0 - Language" section and set "C++ Language Dialect" to "C++0X" and "C++ Standard Library" to "libc++".

The std::move(), move constructor and R-Value reference are known to work as expected, and I'm testing on the std::thread and std::atomic.

Problem

I am considering the use of some C++11 features (like `auto` for instance) in some cross-platform projects (Windows+Mac). On Windows, Visual Studio supports parts of the upcoming C++11 standard that would allow me to simplify parts of the code base so naturally I would be interested in starting to use these features. But as far as I am aware, the current XCode version (3.2.4 + GCC 4.2) does not support any C++11 features at all. Can I upgrade the GCC version or the CLang version somehow? Or should I just bite my tongue and wait for Apple to package a new version sometime in the future?

Original source

Related problems