aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-12-06 20:12:03 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-12-06 20:12:03 +0000
commitb283da20cb2ad5e386ae04e004fbe80576f508fb (patch)
tree7e7878578d301464f5af6cc43d20715d26b637cd
parentfb4f3a2591782f8643f06724703d2e5b03af36d2 (diff)
Simplify PDiag's move assignment overload a bit, the self-move check isn't actually necessary.
This just empties out the diag, which is fine. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169542 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/PartialDiagnostic.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/include/clang/Basic/PartialDiagnostic.h b/include/clang/Basic/PartialDiagnostic.h
index 63363a9e93..0ac42961d3 100644
--- a/include/clang/Basic/PartialDiagnostic.h
+++ b/include/clang/Basic/PartialDiagnostic.h
@@ -253,17 +253,13 @@ public:
#if LLVM_HAS_RVALUE_REFERENCES
PartialDiagnostic &operator=(PartialDiagnostic &&Other) {
- if (this != &Other) {
- if (DiagStorage)
- freeStorage();
-
- DiagID = Other.DiagID;
- DiagStorage = Other.DiagStorage;
- Allocator = Other.Allocator;
+ freeStorage();
- Other.DiagStorage = 0;
- }
+ DiagID = Other.DiagID;
+ DiagStorage = Other.DiagStorage;
+ Allocator = Other.Allocator;
+ Other.DiagStorage = 0;
return *this;
}
#endif