[llvm] [CommandLine] Make options of copyable class types get reset to their provided initial values (PR #173026)
Jakub Kuderski via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 16 07:16:52 PST 2026
================
@@ -2641,6 +2641,17 @@ template <typename T> using has_sizeof = decltype(sizeof(T));
template <typename T>
constexpr bool is_incomplete_v = !is_detected<detail::has_sizeof, T>::value;
+// Detect types with equality comparison operators.
+namespace detail {
+template <class T>
+using has_equality_comparison =
+ decltype(std::declval<T &>() == std::declval<T &>());
+} // namespace detail
+
+/// Detects whether type `T` can be compared for equality with itself.
+template <typename T>
+constexpr bool has_equality_comparison_v =
----------------
kuhar wrote:
Either define it locally in command line code or open a separate PR for STLExtras changes and add unit tests for this.
https://github.com/llvm/llvm-project/pull/173026
More information about the llvm-commits
mailing list