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 f60f63eee25e4d2309f53858b4c9dcde6237d270..d24e9526b449eb5c7cbe824344e62ae25f743636 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 6f438117966704caba60a28a7021e13558180afa..b860c21e3e60648398ab076565e28b78960185c4 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 59e20b7c049807231d1ef49f7f67c55f277190b3..3de855ffde0d96f78836975a2d929d468ad77a04 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 71c8c7d3768c2beaa92ad77d90ad8903a7c73bb9..eeeae45cd73133dece122dd3000893d9caacc7be 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)