]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* c-cppbuiltin.c (c_cpp_builtins): Fix __cpp_range_based_for.
authorJason Merrill <jason@redhat.com>
Fri, 22 Apr 2016 16:16:27 +0000 (12:16 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 22 Apr 2016 16:16:27 +0000 (12:16 -0400)
From-SVN: r235371

gcc/c-family/ChangeLog
gcc/c-family/c-cppbuiltin.c

index fc772147ae88a0b95c06e21e3133b044e27a3e0b..085d16ab689b9a8262faace3970dd8cd52151738 100644 (file)
@@ -1,3 +1,7 @@
+2016-04-22  Jason Merrill  <jason@redhat.com>
+
+       * c-cppbuiltin.c (c_cpp_builtins): Fix __cpp_range_based_for.
+
 2016-04-20  Ilya Verbin  <ilya.verbin@intel.com>
 
        PR c++/69363
index 94523b8fc7c121aeecfae14c4bb3a35f9cab37d7..408ad4747a330fbc7402c34022a052b31523f206 100644 (file)
@@ -841,7 +841,8 @@ c_cpp_builtins (cpp_reader *pfile)
          cpp_define (pfile, "__cpp_lambdas=200907");
          if (cxx_dialect == cxx11)
            cpp_define (pfile, "__cpp_constexpr=200704");
-         cpp_define (pfile, "__cpp_range_based_for=201603");
+         if (cxx_dialect <= cxx14)
+           cpp_define (pfile, "__cpp_range_based_for=200907");
          if (cxx_dialect <= cxx14)
            cpp_define (pfile, "__cpp_static_assert=200410");
          cpp_define (pfile, "__cpp_decltype=200707");
@@ -877,6 +878,7 @@ c_cpp_builtins (cpp_reader *pfile)
          cpp_define (pfile, "__cpp_nested_namespace_definitions=201411");
          cpp_define (pfile, "__cpp_fold_expressions=201603");
          cpp_define (pfile, "__cpp_nontype_template_args=201411");
+         cpp_define (pfile, "__cpp_range_based_for=201603");
        }
       if (flag_concepts)
        /* Use a value smaller than the 201507 specified in