]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: P2493 feature test macro updates
authorJason Merrill <jason@redhat.com>
Wed, 9 Feb 2022 05:30:49 +0000 (00:30 -0500)
committerJason Merrill <jason@redhat.com>
Wed, 9 Feb 2022 14:41:01 +0000 (09:41 -0500)
The C++ committee just updated the values of these macros to reflect some
late C++20 papers that we implement but others don't yet; see PR103891.

gcc/c-family/ChangeLog:

* c-cppbuiltin.cc (c_cpp_builtins): Update values
of __cpp_constexpr and __cpp_concepts for C++20.

gcc/testsuite/ChangeLog:

* g++.dg/cpp23/feat-cxx2b.C: Adjust.
* g++.dg/cpp2a/feat-cxx2a.C: Adjust.

gcc/c-family/c-cppbuiltin.cc
gcc/testsuite/g++.dg/cpp23/feat-cxx2b.C
gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C

index 528211cf50e3a76f345eb409c83d49785e27a84b..4672ae8486a74b832bb865f03f721eeb112417b9 100644 (file)
@@ -1059,7 +1059,7 @@ c_cpp_builtins (cpp_reader *pfile)
          cpp_define (pfile, "__cpp_generic_lambdas=201707L");
          cpp_define (pfile, "__cpp_designated_initializers=201707L");
          if (cxx_dialect <= cxx20)
-           cpp_define (pfile, "__cpp_constexpr=201907L");
+           cpp_define (pfile, "__cpp_constexpr=202002L");
          cpp_define (pfile, "__cpp_constexpr_in_decltype=201711L");
          cpp_define (pfile, "__cpp_conditional_explicit=201806L");
          cpp_define (pfile, "__cpp_consteval=201811L");
@@ -1084,7 +1084,7 @@ c_cpp_builtins (cpp_reader *pfile)
       if (flag_concepts)
         {
          if (cxx_dialect >= cxx20)
-            cpp_define (pfile, "__cpp_concepts=201907L");
+           cpp_define (pfile, "__cpp_concepts=202002L");
           else
             cpp_define (pfile, "__cpp_concepts=201507L");
         }
index 923e6bcf65ec569f8606d77b838ebd48de5eddde..c1f91e78e66cb5cca6a925f644e071b7b38a6901 100644 (file)
 
 #ifndef __cpp_concepts
 #  error "__cpp_concepts"
-#elif __cpp_concepts != 201907
-#  error "__cpp_concepts != 201907"
+#elif __cpp_concepts != 202002
+#  error "__cpp_concepts != 202002"
 #endif
 
 #ifndef __cpp_using_enum
index 3239df824fca00aa9ff55dd8c5e1155079ae5422..c65ea6bf48a83e502c64618384b72fa14c6ec304 100644 (file)
 
 #ifndef __cpp_constexpr
 #  error "__cpp_constexpr"
-#elif __cpp_constexpr != 201907
-#  error "__cpp_constexpr != 201907"
+#elif __cpp_constexpr != 202002
+#  error "__cpp_constexpr != 202002"
 #endif
 
 #ifndef __cpp_decltype_auto
 
 #ifndef __cpp_concepts
 #  error "__cpp_concepts"
-#elif __cpp_concepts != 201907
-#  error "__cpp_concepts != 201907"
+#elif __cpp_concepts != 202002
+#  error "__cpp_concepts != 202002"
 #endif
 
 #ifndef __cpp_using_enum