diff --git a/include/llvm/Support/ErrorOr.h b/include/llvm/Support/ErrorOr.h index 4914a1d7d5f..543f50766ec 100644 --- a/include/llvm/Support/ErrorOr.h +++ b/include/llvm/Support/ErrorOr.h @@ -70,11 +70,10 @@ public: /// It is used like the following. /// \code /// ErrorOr getBuffer(); -/// void handleError(error_code ec); /// /// auto buffer = getBuffer(); -/// if (!buffer) -/// handleError(buffer); +/// if (error_code ec = buffer.getError()) +/// return ec; /// buffer->write("adena"); /// \endcode ///