c++: Add feature test macro for C++20 using enum.
authorJason Merrill <jason@redhat.com>
Fri, 13 Nov 2020 19:15:46 +0000 (14:15 -0500)
committerJason Merrill <jason@redhat.com>
Fri, 13 Nov 2020 21:34:06 +0000 (16:34 -0500)
Missing piece from the 'using enum' implementation patch.

gcc/c-family/ChangeLog:

* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_using_enum.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/feat-cxx2a.C: Check it.

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

index 15f71e681acb8eaa01e4140adef9377aa4473ca9..7229c59dd6b096001bf04ae346e75bb9c5ecc5b6 100644 (file)
@@ -1005,6 +1005,7 @@ c_cpp_builtins (cpp_reader *pfile)
          cpp_define (pfile, "__cpp_constexpr_dynamic_alloc=201907L");
          cpp_define (pfile, "__cpp_impl_three_way_comparison=201907L");
          cpp_define (pfile, "__cpp_aggregate_paren_init=201902L");
+         cpp_define (pfile, "__cpp_using_enum=201907L");
        }
       if (flag_concepts)
         {
index 7f1fe34ad7fa8aa9b2335e269343ccea6dfc69e3..dc46e48f6d746057a5f5d381246e0809ef7e182c 100644 (file)
 #elif __cpp_concepts != 201907
 #  error "__cpp_concepts != 201907"
 #endif
+
+#ifndef __cpp_using_enum
+#  error "__cpp_using_enum"
+#elif __cpp_using_enum != 201907
+#  error "__cpp_using_enum != 201907"
+#endif