-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[ADT] Remove is_scoped_enum_v
#138134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADT] Remove is_scoped_enum_v
#138134
Conversation
...in old compilers where `std::underlying_type` is not SFINAE-friendly. Fixes buildbot failure https://lab.llvm.org/buildbot/#/builders/134/builds/17904 caused by llvm#138089
@llvm/pr-subscribers-clang @llvm/pr-subscribers-llvm-adt Author: Vlad Serebrennikov (Endilll) Changes...in old compilers where Full diff: https://github.com/llvm/llvm-project/pull/138134.diff 1 Files Affected:
diff --git a/llvm/include/llvm/ADT/STLForwardCompat.h b/llvm/include/llvm/ADT/STLForwardCompat.h
index b8d4babc95fea..c70f4dc29aee0 100644
--- a/llvm/include/llvm/ADT/STLForwardCompat.h
+++ b/llvm/include/llvm/ADT/STLForwardCompat.h
@@ -73,7 +73,8 @@ struct from_range_t {
};
inline constexpr from_range_t from_range{};
-template <typename T, typename UnderlyingT = std::underlying_type_t<T>>
+template <typename T, typename UnderlyingT = typename std::enable_if_t<
+ std::is_enum_v<T>, std::underlying_type<T>>::type>
constexpr bool is_scoped_enum_v =
std::is_enum_v<T> && !std::is_convertible_v<T, UnderlyingT>;
|
is_scoped_enum_v
SFINAE-ableis_scoped_enum_v
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/30468 Here is the relevant piece of the build log for the reference
|
`std::underlying_type` is not SFINAE-friendly in Clang and GCC before 9, and it's too much of a hassle to make it work. Instead, I'm inlining the implementation in the only place it's needed. Fixes buildbot failure https://lab.llvm.org/buildbot/#/builders/134/builds/17904 caused by llvm#138089. Demo: https://godbolt.org/z/9qo3csP98
`std::underlying_type` is not SFINAE-friendly in Clang and GCC before 9, and it's too much of a hassle to make it work. Instead, I'm inlining the implementation in the only place it's needed. Fixes buildbot failure https://lab.llvm.org/buildbot/#/builders/134/builds/17904 caused by llvm#138089. Demo: https://godbolt.org/z/9qo3csP98
`std::underlying_type` is not SFINAE-friendly in Clang and GCC before 9, and it's too much of a hassle to make it work. Instead, I'm inlining the implementation in the only place it's needed. Fixes buildbot failure https://lab.llvm.org/buildbot/#/builders/134/builds/17904 caused by llvm#138089. Demo: https://godbolt.org/z/9qo3csP98
`std::underlying_type` is not SFINAE-friendly in Clang and GCC before 9, and it's too much of a hassle to make it work. Instead, I'm inlining the implementation in the only place it's needed. Fixes buildbot failure https://lab.llvm.org/buildbot/#/builders/134/builds/17904 caused by llvm#138089. Demo: https://godbolt.org/z/9qo3csP98
std::underlying_type
is not SFINAE-friendly in Clang and GCC before 9, and it's too much of a hassle to make it work. Instead, I'm inlining the implementation in the only place it's needed. Fixes buildbot failure https://lab.llvm.org/buildbot/#/builders/134/builds/17904 caused by #138089. Demo: https://godbolt.org/z/9qo3csP98