summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestRunScriptCommand.h
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2019-07-04 16:14:22 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2019-07-14 13:37:30 (GMT)
commit1591f138f1a40fccdde7fb2796ee2d2d8f3f97bb (patch)
tree4db8440a950a88b7c15ea43218f98f61775bf889 /Source/CTest/cmCTestRunScriptCommand.h
parentd9b2c7dae242868f13fc366773fb09448da26e8d (diff)
downloadCMake-1591f138f1a40fccdde7fb2796ee2d2d8f3f97bb.zip
CMake-1591f138f1a40fccdde7fb2796ee2d2d8f3f97bb.tar.gz
CMake-1591f138f1a40fccdde7fb2796ee2d2d8f3f97bb.tar.bz2
modernize: manage cmCommand instances using unique_ptr.
Diffstat (limited to 'Source/CTest/cmCTestRunScriptCommand.h')
-rw-r--r--Source/CTest/cmCTestRunScriptCommand.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/CTest/cmCTestRunScriptCommand.h b/Source/CTest/cmCTestRunScriptCommand.h
index 9d8b4b5..6961f6e 100644
--- a/Source/CTest/cmCTestRunScriptCommand.h
+++ b/Source/CTest/cmCTestRunScriptCommand.h
@@ -6,11 +6,14 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmCTestCommand.h"
+#include "cmCommand.h"
#include <string>
+#include <utility>
#include <vector>
-class cmCommand;
+#include "cm_memory.hxx"
+
class cmExecutionStatus;
/** \class cmCTestRunScript
@@ -27,12 +30,12 @@ public:
/**
* This is a virtual constructor for the command.
*/
- cmCommand* Clone() override
+ std::unique_ptr<cmCommand> Clone() override
{
- cmCTestRunScriptCommand* ni = new cmCTestRunScriptCommand;
+ auto ni = cm::make_unique<cmCTestRunScriptCommand>();
ni->CTest = this->CTest;
ni->CTestScriptHandler = this->CTestScriptHandler;
- return ni;
+ return std::unique_ptr<cmCommand>(std::move(ni));
}
/**