Browse Source

cmMakefile: Prevent copying RAII helpers

Delete copy and assignment operators for public scope helpers in
cmMakefile, as use thereof (at least without careful use of move
constructors, which we don't have) would result in bugs. This helps
guard against improper use, and is consistent with the internal helpers
having these deleted.
Matthew Woehlke 1 year ago
parent
commit
de5700a15a
1 changed files with 6 additions and 0 deletions
  1. 6 0
      Source/cmMakefile.h

+ 6 - 0
Source/cmMakefile.h

@@ -1054,6 +1054,9 @@ public:
   public:
     FindPackageStackRAII(cmMakefile* mf, std::string const& pkg);
     ~FindPackageStackRAII();
+
+    FindPackageStackRAII(FindPackageStackRAII const&) = delete;
+    FindPackageStackRAII& operator=(FindPackageStackRAII const&) = delete;
   };
 
   class DebugFindPkgRAII
@@ -1064,6 +1067,9 @@ public:
   public:
     DebugFindPkgRAII(cmMakefile* mf, std::string const& pkg);
     ~DebugFindPkgRAII();
+
+    DebugFindPkgRAII(DebugFindPkgRAII const&) = delete;
+    DebugFindPkgRAII& operator=(DebugFindPkgRAII const&) = delete;
   };
 
   bool GetDebugFindPkgMode() const;