summaryrefslogtreecommitdiff
path: root/unittests/Frontend/CodeGenActionTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Frontend/CodeGenActionTest.cpp')
-rw-r--r--unittests/Frontend/CodeGenActionTest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/unittests/Frontend/CodeGenActionTest.cpp b/unittests/Frontend/CodeGenActionTest.cpp
index 356b5130fcbe9..1d2a50c8bc208 100644
--- a/unittests/Frontend/CodeGenActionTest.cpp
+++ b/unittests/Frontend/CodeGenActionTest.cpp
@@ -41,7 +41,7 @@ public:
TEST(CodeGenTest, TestNullCodeGen) {
- CompilerInvocation *Invocation = new CompilerInvocation;
+ auto Invocation = std::make_shared<CompilerInvocation>();
Invocation->getPreprocessorOpts().addRemappedFile(
"test.cc",
MemoryBuffer::getMemBuffer("").release());
@@ -50,7 +50,7 @@ TEST(CodeGenTest, TestNullCodeGen) {
Invocation->getFrontendOpts().ProgramAction = EmitLLVM;
Invocation->getTargetOpts().Triple = "i386-unknown-linux-gnu";
CompilerInstance Compiler;
- Compiler.setInvocation(Invocation);
+ Compiler.setInvocation(std::move(Invocation));
Compiler.createDiagnostics();
EXPECT_TRUE(Compiler.hasDiagnostics());