[Mlir-commits] [mlir] dc2aa47 - [mlir] Add a copy constructor to FailureOr

River Riddle llvmlistbot at llvm.org
Tue May 25 12:16:29 PDT 2021


Author: Mathieu Fehr
Date: 2021-05-25T12:10:57-07:00
New Revision: dc2aa476760151d29142aa940029aba21a2f286d

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

LOG: [mlir] Add a copy constructor to FailureOr

The copy constructor was missing from FailureOr.

Note that I do not have commit access.

Differential Revision: https://reviews.llvm.org/D98955

Added: 
    

Modified: 
    mlir/include/mlir/Support/LogicalResult.h

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Support/LogicalResult.h b/mlir/include/mlir/Support/LogicalResult.h
index 0281cb5b0053c..a38de7a901eac 100644
--- a/mlir/include/mlir/Support/LogicalResult.h
+++ b/mlir/include/mlir/Support/LogicalResult.h
@@ -84,6 +84,7 @@ template <typename T> class LLVM_NODISCARD FailureOr : public Optional<T> {
   }
   FailureOr() : FailureOr(failure()) {}
   FailureOr(T &&y) : Optional<T>(std::forward<T>(y)) {}
+  FailureOr(const T &y) : Optional<T>(y) {}
 
   operator LogicalResult() const { return success(this->hasValue()); }
 


        


More information about the Mlir-commits mailing list