Author: David Stone
Date: 2024-05-31T19:23:14+02:00
New Revision: 41ddf128ea2ecfe0c418d2dfb5bbf99538498750

URL: 
https://github.com/llvm/llvm-project/commit/41ddf128ea2ecfe0c418d2dfb5bbf99538498750
DIFF: 
https://github.com/llvm/llvm-project/commit/41ddf128ea2ecfe0c418d2dfb5bbf99538498750.diff

LOG: Remove dangling conversion to `optional<T> &` (#93385)

Added: 
    

Modified: 
    clang/include/clang/Basic/CustomizableOptional.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/CustomizableOptional.h 
b/clang/include/clang/Basic/CustomizableOptional.h
index 84d40025ee41b..2d6ae6a781a55 100644
--- a/clang/include/clang/Basic/CustomizableOptional.h
+++ b/clang/include/clang/Basic/CustomizableOptional.h
@@ -97,14 +97,6 @@ template <typename T> class CustomizableOptional {
   template <typename U> T value_or(U &&alt) && {
     return has_value() ? std::move(operator*()) : std::forward<U>(alt);
   }
-
-  // Allow conversion to std::optional<T>.
-  explicit operator std::optional<T> &() const & {
-    return *this ? **this : std::optional<T>();
-  }
-  explicit operator std::optional<T> &&() const && {
-    return *this ? std::move(**this) : std::optional<T>();
-  }
 };
 
 template <typename T>


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to