Fix logic error in check() function.

llvm-svn: 274195
This commit is contained in:
Peter Collingbourne 2016-06-30 00:32:24 +00:00
parent f7493393fc
commit 66ec178c6c
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ template <typename T> void error(const ErrorOr<T> &V, const Twine &Prefix) {
}
template <class T> T check(Expected<T> E, const Twine &Prefix) {
if (!E)
if (E)
return std::move(*E);
error(E.takeError(), Prefix);
return T();