Recommit 213307: unique_ptr-ify ownership of ASTConsumers (reverted in r213325)
After post-commit review and community discussion, this seems like a
reasonable direction to continue, making ownership semantics explicit in
the source using the type system.
llvm-svn: 215323
diff --git a/clang/unittests/Sema/ExternalSemaSourceTest.cpp b/clang/unittests/Sema/ExternalSemaSourceTest.cpp
index bc0d632..4291b76 100644
--- a/clang/unittests/Sema/ExternalSemaSourceTest.cpp
+++ b/clang/unittests/Sema/ExternalSemaSourceTest.cpp
@@ -140,10 +140,10 @@
std::unique_ptr<DiagnosticConsumer> OwnedClient;
protected:
- virtual clang::ASTConsumer *
+ virtual std::unique_ptr<clang::ASTConsumer>
CreateASTConsumer(clang::CompilerInstance &Compiler,
llvm::StringRef /* dummy */) {
- return new clang::ASTConsumer();
+ return llvm::make_unique<clang::ASTConsumer>();
}
virtual void ExecuteAction() {