projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7aba60c
)
[docs] Clarify Error example in Programmer's Manual.
author
Lang Hames
<lhames@gmail.com>
Thu, 24 Mar 2016 18:05:21 +0000
(18:05 +0000)
committer
Lang Hames
<lhames@gmail.com>
Thu, 24 Mar 2016 18:05:21 +0000
(18:05 +0000)
llvm-svn: 264314
llvm/docs/ProgrammersManual.rst
patch
|
blob
|
history
diff --git
a/llvm/docs/ProgrammersManual.rst
b/llvm/docs/ProgrammersManual.rst
index
88a8f88
..
3779225
100644
(file)
--- a/
llvm/docs/ProgrammersManual.rst
+++ b/
llvm/docs/ProgrammersManual.rst
@@
-361,11
+361,13
@@
success, enabling the following idiom:
.. code-block:: c++
- if (auto Err = mayFail())
- return Err;
-
- // Success! We can proceed.
+ Error mayFail();
+ Error foo() {
+ if (auto Err = mayFail())
+ return Err;
+ // Success! We can proceed.
+ ...
For functions that can fail but need to return a value the ``Expected<T>``
utility can be used. Values of this type can be constructed with either a