From 80f3b5af18430bca9bed209f854b1429051a054b Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 9 Jan 2014 14:40:43 +0000 Subject: Update example to be more idiomatic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198872 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/ErrorOr.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/llvm/Support/ErrorOr.h b/include/llvm/Support/ErrorOr.h index 4914a1d7d5..543f50766e 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 /// -- cgit v1.2.3