Index: c-family/c-cppbuiltin.c =================================================================== --- c-family/c-cppbuiltin.c (revision 198231) +++ c-family/c-cppbuiltin.c (working copy) @@ -713,8 +713,10 @@ c_cpp_builtins (cpp_reader *pfile) cpp_define (pfile, "__DEPRECATED"); if (flag_rtti) cpp_define (pfile, "__GXX_RTTI"); - if (cxx_dialect >= cxx0x) + if (cxx_dialect == cxx0x) cpp_define (pfile, "__GXX_EXPERIMENTAL_CXX0X__"); + if (cxx_dialect >= cxx1y) + cpp_define (pfile, "__GXX_EXPERIMENTAL_CXX1Y__"); } /* Note that we define this for C as well, so that we know if __attribute__((cleanup)) will interface with EH. */ Index: doc/cpp.texi =================================================================== --- doc/cpp.texi (revision 198231) +++ doc/cpp.texi (working copy) @@ -2319,6 +2319,13 @@ features likely to be included in C++0x are availa features are experimental, and may change or be removed in future versions of GCC. +@item __GXX_EXPERIMENTAL_CXX1Y__ +This macro is defined when compiling a C++ source file with the option +@option{-std=c++1y} or @option{-std=gnu++1y}. It indicates that some +features likely to be included in C++1y are available. Note that these +features are experimental, and may change or be removed in future +versions of GCC. + @item __GXX_WEAK__ This macro is defined when compiling a C++ source file. It has the value 1 if the compiler will use weak symbols, COMDAT sections, or Index: testsuite/g++.dg/cpp1y/cxx1y_macro.C =================================================================== --- testsuite/g++.dg/cpp1y/cxx1y_macro.C (revision 0) +++ testsuite/g++.dg/cpp1y/cxx1y_macro.C (working copy) @@ -0,0 +1,5 @@ +// { dg-options "-std=c++1y" } + +#ifndef __GXX_EXPERIMENTAL_CXX1Y__ +#error +#endif