From GCC's C++0x page:
GCC's C++11 mode implements much of the C++11 standard produced by the ISO C++ committee. The standard is available from various national standards bodies; working papers from before the release of the standard are available on the ISO C++ committee's web site at http://www.open-std.org/jtc1/sc22/wg21/. Since this standard has only recently been completed, the feature set provided by the experimental C++11 mode may vary greatly from one GCC version to another. No attempts will be made to preserve backward compatibility with C++11 features whose semantics have changed during the course of C++11 standardization.
The std=c++11
flag was also introduced in GCC 4.7. From man gcc
(I did not find it in info gcc
):
c++11
c++0x
The 2011 ISO C++ standard plus amendments. Support for C++11
is still experimental, and may change in incompatible ways in
future releases. The name c++0x is deprecated.
I take this to mean in the latest compiler version, the flags are identical, but you should prefer c++11
instead to avoid potential bugs.
From the info gcc
command:
The default, if no C++ language dialect options are given, is '-std=gnu++98'.
This means c++98
with extensions.