On Fri, Mar 19, 2021 at 3:13 PM Jonathan Wakely via Libstdc++ <libstd...@gcc.gnu.org> wrote: > > Implement this C++23 feature, as proposed by P1048R1. > > This implementation assumes that a C++23 compiler supports concepts > already. I don't see any point in using preprocessor hacks to detect > compilers which define __cplusplus to a post-C++20 value but don't > support concepts yet. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_scoped_enum): Define. > * include/std/version (__cpp_lib_is_scoped_enum): Define. > * testsuite/20_util/is_scoped_enum/value.cc: New test. > * testsuite/20_util/is_scoped_enum/version.cc: New test. > > Tested powerpc64le-linux. Committed to trunk. >
Using __underlying_type breaks for incomplete enumeration types. GCC doesn't have incomplete scoped enums due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89025 but unscoped ones exist: enum E { x = std::is_scoped_enum_v<E> };