From de5700a15ae761f5655ca016c41a86ee99016795 Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Wed, 4 Dec 2024 15:13:15 -0500 Subject: [PATCH] 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. --- Source/cmMakefile.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 6e1739e672..de22227510 100644 --- a/Source/cmMakefile.h +++ b/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;