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:
63ffde5
)
[Core] Fix passing an rvalue reference of ErrorOr.
author
Michael J. Spencer
<bigcheesegs@gmail.com>
Fri, 18 Jan 2013 21:42:01 +0000
(21:42 +0000)
committer
Michael J. Spencer
<bigcheesegs@gmail.com>
Fri, 18 Jan 2013 21:42:01 +0000
(21:42 +0000)
llvm-svn: 172850
lld/include/lld/Core/ErrorOr.h
patch
|
blob
|
history
diff --git
a/lld/include/lld/Core/ErrorOr.h
b/lld/include/lld/Core/ErrorOr.h
index 0fd7d9650b827592327cdce525f17488667b8f50..85f91858db54ee60dd80fec347db1009ac687702 100644
(file)
--- a/
lld/include/lld/Core/ErrorOr.h
+++ b/
lld/include/lld/Core/ErrorOr.h
@@
-208,6
+208,7
@@
public:
return;
if (!other.HasError) {
// Get the other value.
+ IsValid = true;
new (get()) storage_type(std::move(*other.get()));
HasError = false;
// Tell other not to do any destruction.
@@
-228,7
+229,7
@@
public:
return *this;
this->~ErrorOr();
- new (this) ErrorOr(
other
);
+ new (this) ErrorOr(
std::move(other)
);
return *this;
}