diff --git a/include/llvm/Support/ErrorOr.h b/include/llvm/Support/ErrorOr.h index fba67054cb9..bc376e97aef 100644 --- a/include/llvm/Support/ErrorOr.h +++ b/include/llvm/Support/ErrorOr.h @@ -203,7 +203,7 @@ private: } else { // Get other's error. HasError = true; - new (getErrorStorage()) error_code(Other); + new (getErrorStorage()) error_code(Other.getError()); } }