diff options
| author | Albert Astals Cid <aacid@kde.org> | 2019-01-10 20:47:08 +0100 | 
|---|---|---|
| committer | Albert Astals Cid <aacid@kde.org> | 2019-01-10 21:03:36 +0100 | 
| commit | 601faf2ad9d4c4ed94c5b753461388a1da32ddf3 (patch) | |
| tree | 2a7a8cada01be95ae477f1e0f8ab9ab92362b842 | |
| parent | 78da515c5deb984452524069cf7c62a6a68be626 (diff) | |
| download | kconfig-601faf2ad9d4c4ed94c5b753461388a1da32ddf3.tar.gz kconfig-601faf2ad9d4c4ed94c5b753461388a1da32ddf3.tar.bz2 | |
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
| -rw-r--r-- | autotests/kconfig_compiler/test10.cpp.ref | 2 | ||||
| -rw-r--r-- | autotests/kconfig_compiler/test4.cpp.ref | 2 | ||||
| -rw-r--r-- | autotests/kconfig_compiler/test5.cpp.ref | 2 | ||||
| -rw-r--r-- | autotests/kconfig_compiler/test8b.cpp.ref | 2 | ||||
| -rw-r--r-- | autotests/kconfig_compiler/test8c.cpp.ref | 2 | ||||
| -rw-r--r-- | autotests/kconfig_compiler/test_dpointer.cpp.ref | 2 | ||||
| -rw-r--r-- | autotests/kconfig_compiler/test_signal.cpp.ref | 2 | ||||
| -rw-r--r-- | src/kconfig_compiler/kconfig_compiler.cpp | 2 | 
8 files changed, 16 insertions, 0 deletions
| diff --git a/autotests/kconfig_compiler/test10.cpp.ref b/autotests/kconfig_compiler/test10.cpp.ref index 12e3a431..f5590c20 100644 --- a/autotests/kconfig_compiler/test10.cpp.ref +++ b/autotests/kconfig_compiler/test10.cpp.ref @@ -11,6 +11,8 @@ class Test10Helper    public:      Test10Helper() : q(nullptr) {}      ~Test10Helper() { delete q; } +    Test10Helper(const Test10Helper&) = delete; +    Test10Helper& operator=(const Test10Helper&) = delete;      Test10 *q;  };  Q_GLOBAL_STATIC(Test10Helper, s_globalTest10) diff --git a/autotests/kconfig_compiler/test4.cpp.ref b/autotests/kconfig_compiler/test4.cpp.ref index 160f340d..29498c2c 100644 --- a/autotests/kconfig_compiler/test4.cpp.ref +++ b/autotests/kconfig_compiler/test4.cpp.ref @@ -11,6 +11,8 @@ class Test4Helper    public:      Test4Helper() : q(nullptr) {}      ~Test4Helper() { delete q; } +    Test4Helper(const Test4Helper&) = delete; +    Test4Helper& operator=(const Test4Helper&) = delete;      Test4 *q;  };  Q_GLOBAL_STATIC(Test4Helper, s_globalTest4) diff --git a/autotests/kconfig_compiler/test5.cpp.ref b/autotests/kconfig_compiler/test5.cpp.ref index 0c33483b..dfa27f3b 100644 --- a/autotests/kconfig_compiler/test5.cpp.ref +++ b/autotests/kconfig_compiler/test5.cpp.ref @@ -11,6 +11,8 @@ class Test5Helper    public:      Test5Helper() : q(nullptr) {}      ~Test5Helper() { delete q; } +    Test5Helper(const Test5Helper&) = delete; +    Test5Helper& operator=(const Test5Helper&) = delete;      Test5 *q;  };  Q_GLOBAL_STATIC(Test5Helper, s_globalTest5) diff --git a/autotests/kconfig_compiler/test8b.cpp.ref b/autotests/kconfig_compiler/test8b.cpp.ref index 0400de1e..367d8051 100644 --- a/autotests/kconfig_compiler/test8b.cpp.ref +++ b/autotests/kconfig_compiler/test8b.cpp.ref @@ -11,6 +11,8 @@ class Test8bHelper    public:      Test8bHelper() : q(nullptr) {}      ~Test8bHelper() { delete q; } +    Test8bHelper(const Test8bHelper&) = delete; +    Test8bHelper& operator=(const Test8bHelper&) = delete;      Test8b *q;  };  Q_GLOBAL_STATIC(Test8bHelper, s_globalTest8b) diff --git a/autotests/kconfig_compiler/test8c.cpp.ref b/autotests/kconfig_compiler/test8c.cpp.ref index 0d3042ea..98654e5e 100644 --- a/autotests/kconfig_compiler/test8c.cpp.ref +++ b/autotests/kconfig_compiler/test8c.cpp.ref @@ -13,6 +13,8 @@ class Test8cHelper    public:      Test8cHelper() : q(nullptr) {}      ~Test8cHelper() { delete q; } +    Test8cHelper(const Test8cHelper&) = delete; +    Test8cHelper& operator=(const Test8cHelper&) = delete;      Test8c *q;  };  Q_GLOBAL_STATIC(Test8cHelper, s_globalTest8c) diff --git a/autotests/kconfig_compiler/test_dpointer.cpp.ref b/autotests/kconfig_compiler/test_dpointer.cpp.ref index 5436eb2a..9c6eae37 100644 --- a/autotests/kconfig_compiler/test_dpointer.cpp.ref +++ b/autotests/kconfig_compiler/test_dpointer.cpp.ref @@ -50,6 +50,8 @@ class TestDPointerHelper    public:      TestDPointerHelper() : q(nullptr) {}      ~TestDPointerHelper() { delete q; } +    TestDPointerHelper(const TestDPointerHelper&) = delete; +    TestDPointerHelper& operator=(const TestDPointerHelper&) = delete;      TestDPointer *q;  };  Q_GLOBAL_STATIC(TestDPointerHelper, s_globalTestDPointer) diff --git a/autotests/kconfig_compiler/test_signal.cpp.ref b/autotests/kconfig_compiler/test_signal.cpp.ref index 6451f811..44366218 100644 --- a/autotests/kconfig_compiler/test_signal.cpp.ref +++ b/autotests/kconfig_compiler/test_signal.cpp.ref @@ -11,6 +11,8 @@ class TestSignalHelper    public:      TestSignalHelper() : q(nullptr) {}      ~TestSignalHelper() { delete q; } +    TestSignalHelper(const TestSignalHelper&) = delete; +    TestSignalHelper& operator=(const TestSignalHelper&) = delete;      TestSignal *q;  };  Q_GLOBAL_STATIC(TestSignalHelper, s_globalTestSignal) 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); | 
