c++: Add feature test macro for C++20 using enum.

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.
This commit is contained in:
Jason Merrill 2020-11-13 14:15:46 -05:00
parent 1a90e99fa2
commit d4a3152d3f
2 changed files with 7 additions and 0 deletions

View 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)
{

View File

@ -533,3 +533,9 @@
#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