summaryrefslogtreecommitdiffstats
path: root/clang/unittests/AST
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/AST')
-rw-r--r--clang/unittests/AST/ExternalASTSourceTest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/unittests/AST/ExternalASTSourceTest.cpp b/clang/unittests/AST/ExternalASTSourceTest.cpp
index 4b3bb3e2b69..513ff5b99fa 100644
--- a/clang/unittests/AST/ExternalASTSourceTest.cpp
+++ b/clang/unittests/AST/ExternalASTSourceTest.cpp
@@ -49,14 +49,14 @@ bool testExternalASTSource(ExternalASTSource *Source,
CompilerInstance Compiler;
Compiler.createDiagnostics();
- CompilerInvocation *Invocation = new CompilerInvocation;
+ auto Invocation = std::make_shared<CompilerInvocation>();
Invocation->getPreprocessorOpts().addRemappedFile(
"test.cc", MemoryBuffer::getMemBuffer(FileContents).release());
const char *Args[] = { "test.cc" };
CompilerInvocation::CreateFromArgs(*Invocation, Args,
Args + array_lengthof(Args),
Compiler.getDiagnostics());
- Compiler.setInvocation(Invocation);
+ Compiler.setInvocation(std::move(Invocation));
TestFrontendAction Action(Source);
return Compiler.ExecuteAction(Action);
OpenPOWER on IntegriCloud