Index: llvm/trunk/include/llvm/Support/Error.h =================================================================== --- llvm/trunk/include/llvm/Support/Error.h +++ llvm/trunk/include/llvm/Support/Error.h @@ -429,7 +429,7 @@ static const bool isRef = std::is_reference::value; - using wrap = ReferenceStorage::type>; + using wrap = std::reference_wrapper::type>; using error_type = std::unique_ptr; Index: llvm/trunk/include/llvm/Support/ErrorOr.h =================================================================== --- llvm/trunk/include/llvm/Support/ErrorOr.h +++ llvm/trunk/include/llvm/Support/ErrorOr.h @@ -24,18 +24,6 @@ namespace llvm { -/// Stores a reference that can be changed. -template -class ReferenceStorage { - T *Storage; - -public: - ReferenceStorage(T &Ref) : Storage(&Ref) {} - - operator T &() const { return *Storage; } - T &get() const { return *Storage; } -}; - /// Represents either an error or a value T. /// /// ErrorOr is a pointer-like class that represents the result of an @@ -71,7 +59,7 @@ static const bool isRef = std::is_reference::value; - using wrap = ReferenceStorage::type>; + using wrap = std::reference_wrapper::type>; public: using storage_type = typename std::conditional::type;