Use the existing typedef to avoid forming a reference to a reference.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 9 Jan 2014 00:25:25 +0000 (00:25 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 9 Jan 2014 00:25:25 +0000 (00:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198817 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/ErrorOr.h

index bc376e97aef154c23e4290d3ee26eb1e43c84745..4914a1d7d5f2edb358658658e0d5d2568e6fdf4b 100644 (file)
@@ -178,8 +178,8 @@ public:
     return HasError ? 0 : unspecified_bool_true;
   }
 
-  T &get() { return *getStorage(); }
-  const T &get() const { return const_cast<ErrorOr<T> >(this)->get(); }
+  reference get() { return *getStorage(); }
+  const reference get() const { return const_cast<ErrorOr<T> >(this)->get(); }
 
   error_code getError() const {
     return HasError ? *getErrorStorage() : error_code::success();