浏览代码

Merge topic 'delete_copy_assign'

ae5e97a005 Delete some default constructors and assignment operators

Acked-by: Kitware Robot <[email protected]>
Merge-request: !2968
Brad King 6 年之前
父节点
当前提交
03e10384ec

+ 3 - 0
Source/CPack/cmCPackGeneratorFactory.h

@@ -22,6 +22,9 @@ public:
   cmCPackGeneratorFactory();
   cmCPackGeneratorFactory();
   ~cmCPackGeneratorFactory();
   ~cmCPackGeneratorFactory();
 
 
+  cmCPackGeneratorFactory(const cmCPackGeneratorFactory&) = delete;
+  cmCPackGeneratorFactory& operator=(const cmCPackGeneratorFactory&) = delete;
+
   //! Get the generator
   //! Get the generator
   cmCPackGenerator* NewGenerator(const std::string& name);
   cmCPackGenerator* NewGenerator(const std::string& name);
   void DeleteGenerator(cmCPackGenerator* gen);
   void DeleteGenerator(cmCPackGenerator* gen);

+ 3 - 0
Source/CPack/cmCPackLog.h

@@ -26,6 +26,9 @@ public:
   cmCPackLog();
   cmCPackLog();
   ~cmCPackLog();
   ~cmCPackLog();
 
 
+  cmCPackLog(const cmCPackLog&) = delete;
+  cmCPackLog& operator=(const cmCPackLog&) = delete;
+
   enum __log_tags
   enum __log_tags
   {
   {
     NOTAG = 0,
     NOTAG = 0,

+ 5 - 0
Source/CTest/cmCTestBuildAndTestHandler.cxx

@@ -140,6 +140,11 @@ public:
     cmSystemTools::SetStdoutCallback(nullptr);
     cmSystemTools::SetStdoutCallback(nullptr);
     cmSystemTools::SetMessageCallback(nullptr);
     cmSystemTools::SetMessageCallback(nullptr);
   }
   }
+
+  cmCTestBuildAndTestCaptureRAII(const cmCTestBuildAndTestCaptureRAII&) =
+    delete;
+  cmCTestBuildAndTestCaptureRAII& operator=(
+    const cmCTestBuildAndTestCaptureRAII&) = delete;
 };
 };
 
 
 int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
 int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)

+ 2 - 0
Source/CTest/cmCTestBuildHandler.cxx

@@ -680,6 +680,8 @@ class cmCTestBuildHandler::LaunchHelper
 public:
 public:
   LaunchHelper(cmCTestBuildHandler* handler);
   LaunchHelper(cmCTestBuildHandler* handler);
   ~LaunchHelper();
   ~LaunchHelper();
+  LaunchHelper(const LaunchHelper&) = delete;
+  LaunchHelper& operator=(const LaunchHelper&) = delete;
 
 
 private:
 private:
   cmCTestBuildHandler* Handler;
   cmCTestBuildHandler* Handler;

+ 5 - 0
Source/CTest/cmCTestCoverageHandler.cxx

@@ -52,6 +52,8 @@ public:
     }
     }
     cmsysProcess_Delete(this->Process);
     cmsysProcess_Delete(this->Process);
   }
   }
+  cmCTestRunProcess(const cmCTestRunProcess&) = delete;
+  cmCTestRunProcess& operator=(const cmCTestRunProcess&) = delete;
   void SetCommand(const char* command)
   void SetCommand(const char* command)
   {
   {
     this->CommandLineStrings.clear();
     this->CommandLineStrings.clear();
@@ -786,6 +788,9 @@ struct cmCTestCoverageHandlerLocale
       cmSystemTools::UnsetEnv("LC_ALL");
       cmSystemTools::UnsetEnv("LC_ALL");
     }
     }
   }
   }
+  cmCTestCoverageHandlerLocale(const cmCTestCoverageHandlerLocale&) = delete;
+  cmCTestCoverageHandlerLocale& operator=(
+    const cmCTestCoverageHandlerLocale&) = delete;
   std::string lc_all;
   std::string lc_all;
 };
 };
 
 

+ 2 - 0
Source/CTest/cmCTestCurl.h

@@ -16,6 +16,8 @@ class cmCTestCurl
 public:
 public:
   cmCTestCurl(cmCTest*);
   cmCTestCurl(cmCTest*);
   ~cmCTestCurl();
   ~cmCTestCurl();
+  cmCTestCurl(const cmCTestCurl&) = delete;
+  cmCTestCurl& operator=(const cmCTestCurl&) = delete;
   bool UploadFile(std::string const& local_file, std::string const& url,
   bool UploadFile(std::string const& local_file, std::string const& url,
                   std::string const& fields, std::string& response);
                   std::string const& fields, std::string& response);
   bool HttpRequest(std::string const& url, std::string const& fields,
   bool HttpRequest(std::string const& url, std::string const& fields,

+ 2 - 0
Source/CTest/cmCTestHandlerCommand.cxx

@@ -76,6 +76,8 @@ public:
       }
       }
     }
     }
   }
   }
+  SaveRestoreErrorState(const SaveRestoreErrorState&) = delete;
+  SaveRestoreErrorState& operator=(const SaveRestoreErrorState&) = delete;
 
 
 private:
 private:
   bool InitialErrorState;
   bool InitialErrorState;

+ 3 - 0
Source/CTest/cmCTestLaunch.h

@@ -28,6 +28,9 @@ private:
   cmCTestLaunch(int argc, const char* const* argv);
   cmCTestLaunch(int argc, const char* const* argv);
   ~cmCTestLaunch();
   ~cmCTestLaunch();
 
 
+  cmCTestLaunch(const cmCTestLaunch&) = delete;
+  cmCTestLaunch& operator=(const cmCTestLaunch&) = delete;
+
   // Run the real command.
   // Run the real command.
   int Run();
   int Run();
   void RunChild();
   void RunChild();

+ 2 - 0
Source/cmArchiveWrite.cxx

@@ -54,6 +54,8 @@ public:
   {
   {
   }
   }
   ~Entry() { archive_entry_free(this->Object); }
   ~Entry() { archive_entry_free(this->Object); }
+  Entry(const Entry&) = delete;
+  Entry& operator=(const Entry&) = delete;
   operator struct archive_entry*() { return this->Object; }
   operator struct archive_entry*() { return this->Object; }
 };
 };
 
 

+ 3 - 0
Source/cmArchiveWrite.h

@@ -58,6 +58,9 @@ public:
 
 
   ~cmArchiveWrite();
   ~cmArchiveWrite();
 
 
+  cmArchiveWrite(const cmArchiveWrite&) = delete;
+  cmArchiveWrite& operator=(const cmArchiveWrite&) = delete;
+
   /**
   /**
    * Add a path (file or directory) to the archive.  Directories are
    * Add a path (file or directory) to the archive.  Directories are
    * added recursively.  The "path" must be readable on disk, either
    * added recursively.  The "path" must be readable on disk, either

+ 4 - 0
Source/cmCPluginAPI.cxx

@@ -491,12 +491,16 @@ public:
   typedef std::map<cmSourceFile*, cmCPluginAPISourceFile*> derived;
   typedef std::map<cmSourceFile*, cmCPluginAPISourceFile*> derived;
   typedef derived::iterator iterator;
   typedef derived::iterator iterator;
   typedef derived::value_type value_type;
   typedef derived::value_type value_type;
+  cmCPluginAPISourceFileMap() = default;
   ~cmCPluginAPISourceFileMap()
   ~cmCPluginAPISourceFileMap()
   {
   {
     for (auto const& i : *this) {
     for (auto const& i : *this) {
       delete i.second;
       delete i.second;
     }
     }
   }
   }
+  cmCPluginAPISourceFileMap(const cmCPluginAPISourceFileMap&) = delete;
+  cmCPluginAPISourceFileMap& operator=(const cmCPluginAPISourceFileMap&) =
+    delete;
 };
 };
 cmCPluginAPISourceFileMap cmCPluginAPISourceFiles;
 cmCPluginAPISourceFileMap cmCPluginAPISourceFiles;
 
 

+ 3 - 0
Source/cmCTest.h

@@ -182,6 +182,9 @@ public:
   cmCTest();
   cmCTest();
   ~cmCTest();
   ~cmCTest();
 
 
+  cmCTest(const cmCTest&) = delete;
+  cmCTest& operator=(const cmCTest&) = delete;
+
   /** Set the notes files to be created. */
   /** Set the notes files to be created. */
   void SetNotesFiles(const char* notes);
   void SetNotesFiles(const char* notes);
 
 

+ 3 - 0
Source/cmComputeLinkDepends.h

@@ -31,6 +31,9 @@ public:
                        const std::string& config);
                        const std::string& config);
   ~cmComputeLinkDepends();
   ~cmComputeLinkDepends();
 
 
+  cmComputeLinkDepends(const cmComputeLinkDepends&) = delete;
+  cmComputeLinkDepends& operator=(const cmComputeLinkDepends&) = delete;
+
   // Basic information about each link item.
   // Basic information about each link item.
   struct LinkEntry
   struct LinkEntry
   {
   {

+ 3 - 0
Source/cmCustomCommandGenerator.h

@@ -32,6 +32,9 @@ public:
   cmCustomCommandGenerator(cmCustomCommand const& cc, std::string config,
   cmCustomCommandGenerator(cmCustomCommand const& cc, std::string config,
                            cmLocalGenerator* lg);
                            cmLocalGenerator* lg);
   ~cmCustomCommandGenerator();
   ~cmCustomCommandGenerator();
+  cmCustomCommandGenerator(const cmCustomCommandGenerator&) = delete;
+  cmCustomCommandGenerator& operator=(const cmCustomCommandGenerator&) =
+    delete;
   cmCustomCommand const& GetCC() const { return this->CC; }
   cmCustomCommand const& GetCC() const { return this->CC; }
   unsigned int GetNumberOfCommands() const;
   unsigned int GetNumberOfCommands() const;
   std::string GetCommand(unsigned int c) const;
   std::string GetCommand(unsigned int c) const;

+ 4 - 0
Source/cmDependsJavaParserHelper.h

@@ -24,6 +24,10 @@ public:
   cmDependsJavaParserHelper();
   cmDependsJavaParserHelper();
   ~cmDependsJavaParserHelper();
   ~cmDependsJavaParserHelper();
 
 
+  cmDependsJavaParserHelper(const cmDependsJavaParserHelper&) = delete;
+  cmDependsJavaParserHelper& operator=(const cmDependsJavaParserHelper&) =
+    delete;
+
   int ParseString(const char* str, int verb);
   int ParseString(const char* str, int verb);
   int ParseFile(const char* file);
   int ParseFile(const char* file);
 
 

+ 3 - 0
Source/cmELF.h

@@ -28,6 +28,9 @@ public:
   /** Destruct.   */
   /** Destruct.   */
   ~cmELF();
   ~cmELF();
 
 
+  cmELF(const cmELF&) = delete;
+  cmELF& operator=(const cmELF&) = delete;
+
   /** Get the error message if any.  */
   /** Get the error message if any.  */
   std::string const& GetErrorMessage() const { return this->ErrorMessage; }
   std::string const& GetErrorMessage() const { return this->ErrorMessage; }
 
 

+ 3 - 0
Source/cmExportSet.h

@@ -25,6 +25,9 @@ public:
   /// Destructor
   /// Destructor
   ~cmExportSet();
   ~cmExportSet();
 
 
+  cmExportSet(const cmExportSet&) = delete;
+  cmExportSet& operator=(const cmExportSet&) = delete;
+
   void Compute(cmLocalGenerator* lg);
   void Compute(cmLocalGenerator* lg);
 
 
   void AddTargetExport(cmTargetExport* tgt);
   void AddTargetExport(cmTargetExport* tgt);

+ 2 - 0
Source/cmExportSetMap.cxx

@@ -23,6 +23,8 @@ void cmExportSetMap::clear()
   this->derived::clear();
   this->derived::clear();
 }
 }
 
 
+cmExportSetMap::cmExportSetMap() = default;
+
 cmExportSetMap::~cmExportSetMap()
 cmExportSetMap::~cmExportSetMap()
 {
 {
   this->clear();
   this->clear();

+ 5 - 0
Source/cmExportSetMap.h

@@ -25,8 +25,13 @@ public:
 
 
   void clear();
   void clear();
 
 
+  cmExportSetMap();
+
   /// Overloaded destructor deletes all member export sets.
   /// Overloaded destructor deletes all member export sets.
   ~cmExportSetMap();
   ~cmExportSetMap();
+
+  cmExportSetMap(const cmExportSetMap&) = delete;
+  cmExportSetMap& operator=(const cmExportSetMap&) = delete;
 };
 };
 
 
 #endif
 #endif

+ 3 - 0
Source/cmFileCommand.cxx

@@ -2691,6 +2691,9 @@ public:
     }
     }
   }
   }
 
 
+  cURLEasyGuard(const cURLEasyGuard&) = delete;
+  cURLEasyGuard& operator=(const cURLEasyGuard&) = delete;
+
   void release() { this->Easy = nullptr; }
   void release() { this->Easy = nullptr; }
 
 
 private:
 private:

+ 3 - 0
Source/cmFileTimeComparison.h

@@ -20,6 +20,9 @@ public:
   cmFileTimeComparison();
   cmFileTimeComparison();
   ~cmFileTimeComparison();
   ~cmFileTimeComparison();
 
 
+  cmFileTimeComparison(const cmFileTimeComparison&) = delete;
+  cmFileTimeComparison& operator=(const cmFileTimeComparison&) = delete;
+
   /**
   /**
    *  Compare file modification times.
    *  Compare file modification times.
    *  Return true for successful comparison and false for error.
    *  Return true for successful comparison and false for error.

+ 3 - 0
Source/cmFindPackageCommand.cxx

@@ -1372,6 +1372,9 @@ public:
       cmSystemTools::RemoveFile(this->File);
       cmSystemTools::RemoveFile(this->File);
     }
     }
   }
   }
+  cmFindPackageCommandHoldFile(const cmFindPackageCommandHoldFile&) = delete;
+  cmFindPackageCommandHoldFile& operator=(
+    const cmFindPackageCommandHoldFile&) = delete;
   void Release() { this->File = nullptr; }
   void Release() { this->File = nullptr; }
 };
 };
 
 

+ 3 - 0
Source/cmFortranParser.h

@@ -141,6 +141,9 @@ struct cmFortranParser_s
                     std::set<std::string> defines, cmFortranSourceInfo& info);
                     std::set<std::string> defines, cmFortranSourceInfo& info);
   ~cmFortranParser_s();
   ~cmFortranParser_s();
 
 
+  cmFortranParser_s(const cmFortranParser_s&) = delete;
+  cmFortranParser_s& operator=(const cmFortranParser_s&) = delete;
+
   bool FindIncludeFile(const char* dir, const char* includeName,
   bool FindIncludeFile(const char* dir, const char* includeName,
                        std::string& fileName);
                        std::string& fileName);
 
 

+ 6 - 0
Source/cmInstalledFile.h

@@ -32,6 +32,9 @@ public:
     Property();
     Property();
     ~Property();
     ~Property();
 
 
+    Property(const Property&) = delete;
+    Property& operator=(const Property&) = delete;
+
     ExpressionVectorType ValueExpressions;
     ExpressionVectorType ValueExpressions;
   };
   };
 
 
@@ -41,6 +44,9 @@ public:
 
 
   ~cmInstalledFile();
   ~cmInstalledFile();
 
 
+  cmInstalledFile(const cmInstalledFile&) = delete;
+  cmInstalledFile& operator=(const cmInstalledFile&) = delete;
+
   void RemoveProperty(const std::string& prop);
   void RemoveProperty(const std::string& prop);
 
 
   void SetProperty(cmMakefile const* mf, const std::string& prop,
   void SetProperty(cmMakefile const* mf, const std::string& prop,

+ 2 - 0
Source/cmListFileCache.cxx

@@ -27,6 +27,8 @@ struct cmListFileParser
   cmListFileParser(cmListFile* lf, cmListFileBacktrace lfbt,
   cmListFileParser(cmListFile* lf, cmListFileBacktrace lfbt,
                    cmMessenger* messenger, const char* filename);
                    cmMessenger* messenger, const char* filename);
   ~cmListFileParser();
   ~cmListFileParser();
+  cmListFileParser(const cmListFileParser&) = delete;
+  cmListFileParser& operator=(const cmListFileParser&) = delete;
   void IssueFileOpenError(std::string const& text) const;
   void IssueFileOpenError(std::string const& text) const;
   void IssueError(std::string const& text) const;
   void IssueError(std::string const& text) const;
   bool ParseFile();
   bool ParseFile();

+ 12 - 0
Source/cmMakefile.cxx

@@ -348,6 +348,9 @@ public:
     this->Makefile->Backtrace = this->Makefile->Backtrace.Pop();
     this->Makefile->Backtrace = this->Makefile->Backtrace.Pop();
   }
   }
 
 
+  cmMakefileCall(const cmMakefileCall&) = delete;
+  cmMakefileCall& operator=(const cmMakefileCall&) = delete;
+
 private:
 private:
   cmMakefile* Makefile;
   cmMakefile* Makefile;
 };
 };
@@ -439,6 +442,9 @@ public:
   ~IncludeScope();
   ~IncludeScope();
   void Quiet() { this->ReportError = false; }
   void Quiet() { this->ReportError = false; }
 
 
+  IncludeScope(const IncludeScope&) = delete;
+  IncludeScope& operator=(const IncludeScope&) = delete;
+
 private:
 private:
   cmMakefile* Makefile;
   cmMakefile* Makefile;
   bool NoPolicyScope;
   bool NoPolicyScope;
@@ -606,6 +612,9 @@ public:
 
 
   void Quiet() { this->ReportError = false; }
   void Quiet() { this->ReportError = false; }
 
 
+  ListFileScope(const ListFileScope&) = delete;
+  ListFileScope& operator=(const ListFileScope&) = delete;
+
 private:
 private:
   cmMakefile* Makefile;
   cmMakefile* Makefile;
   bool ReportError;
   bool ReportError;
@@ -1497,6 +1506,9 @@ public:
 
 
   void Quiet() { this->ReportError = false; }
   void Quiet() { this->ReportError = false; }
 
 
+  BuildsystemFileScope(const BuildsystemFileScope&) = delete;
+  BuildsystemFileScope& operator=(const BuildsystemFileScope&) = delete;
+
 private:
 private:
   cmMakefile* Makefile;
   cmMakefile* Makefile;
   cmGlobalGenerator* GG;
   cmGlobalGenerator* GG;

+ 9 - 0
Source/cmMakefile.h

@@ -313,6 +313,9 @@ public:
     PolicyPushPop(cmMakefile* m);
     PolicyPushPop(cmMakefile* m);
     ~PolicyPushPop();
     ~PolicyPushPop();
 
 
+    PolicyPushPop(const PolicyPushPop&) = delete;
+    PolicyPushPop& operator=(const PolicyPushPop&) = delete;
+
   private:
   private:
     cmMakefile* Makefile;
     cmMakefile* Makefile;
   };
   };
@@ -743,6 +746,9 @@ public:
                     cmPolicies::PolicyMap const& pm);
                     cmPolicies::PolicyMap const& pm);
     ~FunctionPushPop();
     ~FunctionPushPop();
 
 
+    FunctionPushPop(const FunctionPushPop&) = delete;
+    FunctionPushPop& operator=(const FunctionPushPop&) = delete;
+
     void Quiet() { this->ReportError = false; }
     void Quiet() { this->ReportError = false; }
 
 
   private:
   private:
@@ -757,6 +763,9 @@ public:
                  cmPolicies::PolicyMap const& pm);
                  cmPolicies::PolicyMap const& pm);
     ~MacroPushPop();
     ~MacroPushPop();
 
 
+    MacroPushPop(const MacroPushPop&) = delete;
+    MacroPushPop& operator=(const MacroPushPop&) = delete;
+
     void Quiet() { this->ReportError = false; }
     void Quiet() { this->ReportError = false; }
 
 
   private:
   private:

+ 2 - 0
Source/cmOrderDirectories.h

@@ -25,6 +25,8 @@ public:
   cmOrderDirectories(cmGlobalGenerator* gg, cmGeneratorTarget const* target,
   cmOrderDirectories(cmGlobalGenerator* gg, cmGeneratorTarget const* target,
                      const char* purpose);
                      const char* purpose);
   ~cmOrderDirectories();
   ~cmOrderDirectories();
+  cmOrderDirectories(const cmOrderDirectories&) = delete;
+  cmOrderDirectories& operator=(const cmOrderDirectories&) = delete;
   void AddRuntimeLibrary(std::string const& fullPath,
   void AddRuntimeLibrary(std::string const& fullPath,
                          const char* soname = nullptr);
                          const char* soname = nullptr);
   void AddLinkLibrary(std::string const& fullPath);
   void AddLinkLibrary(std::string const& fullPath);

+ 3 - 0
Source/cmOutputRequiredFilesCommand.cxx

@@ -92,6 +92,9 @@ public:
    */
    */
   ~cmLBDepend() { cmDeleteAll(this->DependInformationMap); }
   ~cmLBDepend() { cmDeleteAll(this->DependInformationMap); }
 
 
+  cmLBDepend(const cmLBDepend&) = delete;
+  cmLBDepend& operator=(const cmLBDepend&) = delete;
+
   /**
   /**
    * Set the makefile that is used as a source of classes.
    * Set the makefile that is used as a source of classes.
    */
    */

+ 3 - 0
Source/cmSourceFile.h

@@ -34,6 +34,9 @@ public:
 
 
   ~cmSourceFile();
   ~cmSourceFile();
 
 
+  cmSourceFile(const cmSourceFile&) = delete;
+  cmSourceFile& operator=(const cmSourceFile&) = delete;
+
   /**
   /**
    * Get the list of the custom commands for this source file
    * Get the list of the custom commands for this source file
    */
    */

+ 3 - 0
Source/cmState.h

@@ -35,6 +35,9 @@ public:
   cmState();
   cmState();
   ~cmState();
   ~cmState();
 
 
+  cmState(const cmState&) = delete;
+  cmState& operator=(const cmState&) = delete;
+
   enum Mode
   enum Mode
   {
   {
     Unknown,
     Unknown,

+ 3 - 1
Source/cmSystemTools.cxx

@@ -521,6 +521,8 @@ public:
     }
     }
     free(this->ArgV);
     free(this->ArgV);
   }
   }
+  cmSystemToolsArgV(const cmSystemToolsArgV&) = delete;
+  cmSystemToolsArgV& operator=(const cmSystemToolsArgV&) = delete;
   void Store(std::vector<std::string>& args) const
   void Store(std::vector<std::string>& args) const
   {
   {
     for (char** arg = this->ArgV; arg && *arg; ++arg) {
     for (char** arg = this->ArgV; arg && *arg; ++arg) {
@@ -533,7 +535,7 @@ void cmSystemTools::ParseUnixCommandLine(const char* command,
                                          std::vector<std::string>& args)
                                          std::vector<std::string>& args)
 {
 {
   // Invoke the underlying parser.
   // Invoke the underlying parser.
-  cmSystemToolsArgV argv = cmsysSystem_Parse_CommandForUnix(command, 0);
+  cmSystemToolsArgV argv(cmsysSystem_Parse_CommandForUnix(command, 0));
   argv.Store(args);
   argv.Store(args);
 }
 }
 
 

+ 3 - 0
Source/cmVariableWatch.h

@@ -72,6 +72,9 @@ protected:
         this->DeleteDataCall(this->ClientData);
         this->DeleteDataCall(this->ClientData);
       }
       }
     }
     }
+    Pair() = default;
+    Pair(const Pair&) = delete;
+    Pair& operator=(const Pair&) = delete;
   };
   };
 
 
   typedef std::vector<std::shared_ptr<Pair>> VectorOfPairs;
   typedef std::vector<std::shared_ptr<Pair>> VectorOfPairs;

+ 3 - 0
Source/cmWorkingDirectory.h

@@ -22,6 +22,9 @@ public:
   cmWorkingDirectory(std::string const& newdir);
   cmWorkingDirectory(std::string const& newdir);
   ~cmWorkingDirectory();
   ~cmWorkingDirectory();
 
 
+  cmWorkingDirectory(const cmWorkingDirectory&) = delete;
+  cmWorkingDirectory& operator=(const cmWorkingDirectory&) = delete;
+
   bool SetDirectory(std::string const& newdir);
   bool SetDirectory(std::string const& newdir);
   void Pop();
   void Pop();
   bool Failed() const { return ResultCode != 0; }
   bool Failed() const { return ResultCode != 0; }

+ 5 - 0
Source/cmXMLWriter.h

@@ -146,6 +146,8 @@ public:
     xmlwr.StartDocument();
     xmlwr.StartDocument();
   }
   }
   ~cmXMLDocument() { xmlwr.EndDocument(); }
   ~cmXMLDocument() { xmlwr.EndDocument(); }
+  cmXMLDocument(const cmXMLDocument&) = delete;
+  cmXMLDocument& operator=(const cmXMLDocument&) = delete;
 
 
 private:
 private:
   friend class cmXMLElement;
   friend class cmXMLElement;
@@ -172,6 +174,9 @@ public:
   }
   }
   ~cmXMLElement() { xmlwr.EndElement(); }
   ~cmXMLElement() { xmlwr.EndElement(); }
 
 
+  cmXMLElement(const cmXMLElement&) = delete;
+  cmXMLElement& operator=(const cmXMLElement&) = delete;
+
   template <typename T>
   template <typename T>
   cmXMLElement& Attribute(const char* name, T const& value)
   cmXMLElement& Attribute(const char* name, T const& value)
   {
   {