[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 08:11:55 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 &>());
----------------
kuhar wrote:

I'd put here:
```suggestion
    decltype(std::declval<const T &>() == std::declval<const T &>());
```

https://github.com/llvm/llvm-project/pull/173026


More information about the llvm-commits mailing list