summaryrefslogtreecommitdiffstats
path: root/unittests
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2014-11-17 23:46:02 +0000
committerAlexander Kornienko <alexfh@google.com>2014-11-17 23:46:02 +0000
commitf98071d4eacb44e7f36b4fd9878f415524a6efda (patch)
treea3b72fa4189a534df74054f516d5374b50f59a10 /unittests
parent7d324b193048890b68444ff2081a362c580112a2 (diff)
Make DiagnosticsEngine::takeClient return std::unique_ptr<>
Summary: Make DiagnosticsEngine::takeClient return std::unique_ptr<>. Updated callers to store conditional ownership using a pair of pointer and unique_ptr instead of a pointer + bool. Updated code that temporarily registers clients to use the non-owning registration (+ removed extra calls to takeClient). Reviewers: dblaikie Reviewed By: dblaikie Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6294 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222193 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Sema/ExternalSemaSourceTest.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/unittests/Sema/ExternalSemaSourceTest.cpp b/unittests/Sema/ExternalSemaSourceTest.cpp
index 4291b76e7d..3a93fc77fb 100644
--- a/unittests/Sema/ExternalSemaSourceTest.cpp
+++ b/unittests/Sema/ExternalSemaSourceTest.cpp
@@ -154,7 +154,7 @@ protected:
DiagnosticsEngine &Diagnostics = CI.getDiagnostics();
DiagnosticConsumer *Client = Diagnostics.getClient();
if (Diagnostics.ownsClient())
- OwnedClient.reset(Diagnostics.takeClient());
+ OwnedClient = Diagnostics.takeClient();
for (size_t I = 0, E = Watchers.size(); I < E; ++I)
Client = Watchers[I]->Chain(Client);
Diagnostics.setClient(Client, false);