From 601faf2ad9d4c4ed94c5b753461388a1da32ddf3 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 10 Jan 2019 20:47:08 +0100 Subject: kconfig_compiler: delete the assignment operator and copy constructor Summary: of the generated class that has a pointer and raw copy would be bad. Those generated classes are internal and nobody would probably have this, but being safe never hurts Reviewers: vkrause Reviewed By: vkrause Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D18136 --- src/kconfig_compiler/kconfig_compiler.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/kconfig_compiler/kconfig_compiler.cpp') diff --git a/src/kconfig_compiler/kconfig_compiler.cpp b/src/kconfig_compiler/kconfig_compiler.cpp index b6b4dade..f04d0bd5 100644 --- a/src/kconfig_compiler/kconfig_compiler.cpp +++ b/src/kconfig_compiler/kconfig_compiler.cpp @@ -2300,6 +2300,8 @@ int main(int argc, char **argv) cpp << " public:" << endl; cpp << " " << cfg.className << "Helper() : q(nullptr) {}" << endl; cpp << " ~" << cfg.className << "Helper() { delete q; }" << endl; + cpp << " " << cfg.className << "Helper(const " << cfg.className << "Helper&) = delete;" << endl; + cpp << " " << cfg.className << "Helper& operator=(const " << cfg.className << "Helper&) = delete;" << endl; cpp << " " << cfg.className << " *q;" << endl; cpp << "};" << endl; endNamespaces(cfg.nameSpace, cpp); -- cgit v1.2.1