Use the existing typedef to avoid forming a reference to a reference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198817 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2014-01-09 00:25:25 +00:00
parent b3ea6d7ce7
commit 217a29303d

View 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();