diff options
author | Andrew Trick <atrick@apple.com> | 2013-02-05 22:50:20 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2013-02-05 22:50:20 +0000 |
commit | 2a78bb961ad99cfc9ae4e8a05a9a5a6bf84e41f3 (patch) | |
tree | c350dda529e96cf533410901a2ba6647b73108c2 /include/llvm/Support | |
parent | 8c74ecfbddabe89e150abff4fdff0a27108874b9 (diff) | |
download | external_llvm-2a78bb961ad99cfc9ae4e8a05a9a5a6bf84e41f3.zip external_llvm-2a78bb961ad99cfc9ae4e8a05a9a5a6bf84e41f3.tar.gz external_llvm-2a78bb961ad99cfc9ae4e8a05a9a5a6bf84e41f3.tar.bz2 |
Revert "[Support][ErrorOr] Add support for convertable types."
This reverts commit a33e1fafac7fedb1b080ef07ddf9ad6ddff3a830.
This unit test crashes on Darwon. It needs to be temporarily reverted
to unblock the test infrastructure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174458 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r-- | include/llvm/Support/ErrorOr.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/include/llvm/Support/ErrorOr.h b/include/llvm/Support/ErrorOr.h index c22c3ca..828d77b 100644 --- a/include/llvm/Support/ErrorOr.h +++ b/include/llvm/Support/ErrorOr.h @@ -162,7 +162,6 @@ public: /// T cannot be a rvalue reference. template<class T> class ErrorOr { - template <class OtherT> friend class ErrorOr; static const bool isRef = is_reference<T>::value; typedef ReferenceStorage<typename remove_reference<T>::type> wrap; @@ -199,8 +198,7 @@ public: new (get()) storage_type(moveIfMoveConstructible<storage_type>(Val)); } - template <class OtherT> - ErrorOr(ErrorOr<OtherT> &Other) : IsValid(false) { + ErrorOr(const ErrorOr &Other) : IsValid(false) { // Construct an invalid ErrorOr if other is invalid. if (!Other.IsValid) return; @@ -228,8 +226,7 @@ public: } #if LLVM_HAS_RVALUE_REFERENCES - template <class OtherT> - ErrorOr(ErrorOr<OtherT> &&Other) : IsValid(false) { + ErrorOr(ErrorOr &&Other) : IsValid(false) { // Construct an invalid ErrorOr if other is invalid. if (!Other.IsValid) return; @@ -311,6 +308,7 @@ private: return &Val->get(); } +protected: storage_type *get() { assert(IsValid && "Can't do anything on a default constructed ErrorOr!"); assert(!HasError && "Cannot get value when an error exists!"); |