c-cppbuiltin.c (c_cpp_builtins): Define __cpp_capture_star_this for -std=c++1z.
authorJakub Jelinek <jakub@redhat.com>
Tue, 27 Sep 2016 19:59:41 +0000 (21:59 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 27 Sep 2016 19:59:41 +0000 (21:59 +0200)
* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_capture_star_this for
-std=c++1z.

* g++.dg/cpp1z/feat-cxx1z.C: Add __cpp_capture_star_this test.

From-SVN: r240557

gcc/c-family/ChangeLog
gcc/c-family/c-cppbuiltin.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C

index f60f63e..d24e952 100644 (file)
@@ -1,5 +1,8 @@
 2016-09-27  Jakub Jelinek  <jakub@redhat.com>
 
+       * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_capture_star_this for
+       -std=c++1z.
+
        * c-ada-spec.c (print_ada_declaration): Remove break after return.
 
 2016-09-26  Thomas Preud'homme  <thomas.preudhomme@arm.com>
index 6f43811..b860c21 100644 (file)
@@ -933,6 +933,7 @@ c_cpp_builtins (cpp_reader *pfile)
          cpp_define (pfile, "__cpp_range_based_for=201603");
          cpp_define (pfile, "__cpp_constexpr=201603");
          cpp_define (pfile, "__cpp_if_constexpr=201606");
+         cpp_define (pfile, "__cpp_capture_star_this=201603");
        }
       if (flag_concepts)
        /* Use a value smaller than the 201507 specified in
index 59e20b7..3de855f 100644 (file)
@@ -1,5 +1,7 @@
 2016-09-27  Jakub Jelinek  <jakub@redhat.com>
 
+       * g++.dg/cpp1z/feat-cxx1z.C: Add __cpp_capture_star_this test.
+
        * g++.dg/cpp1z/lambda-this1.C: New test.
        * g++.dg/cpp1z/lambda-this2.C: New test.
 
index 71c8c7d..eeeae45 100644 (file)
 #  error "__cpp_aligned_new != 201606"
 #endif
 
+#ifndef __cpp_capture_star_this
+#  error "__cpp_capture_star_this"
+#elif __cpp_capture_star_this != 201603
+#  error "__cpp_capture_star_this != 201603"
+#endif
+
 #ifdef __has_cpp_attribute
 
 #  if ! __has_cpp_attribute(maybe_unused)