diff options
author | Tom Tromey <tom@tromey.com> | 2021-05-04 15:26:58 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-05-05 00:06:16 -0600 |
commit | c10a3b13fec850effc68c8b4f8861158f7fa7fed (patch) | |
tree | 28e91c7827d116acb2a00a6eae6a5bcf1a0c143c /libcc1/callbacks.hh | |
parent | 41f4381648feb1e5eaa27d108b21e2b95ad3739d (diff) | |
download | gcc-c10a3b13fec850effc68c8b4f8861158f7fa7fed.zip gcc-c10a3b13fec850effc68c8b4f8861158f7fa7fed.tar.gz gcc-c10a3b13fec850effc68c8b4f8861158f7fa7fed.tar.bz2 |
libcc1: delete copy constructor and assignment operators
Change libcc1 to use "= delete" for the copy constructor and
assignment operator, rather than the old approach of private methods
that are nowhere defined.
libcc1
* rpc.hh (argument_wrapper): Use delete for copy constructor.
* connection.hh (class connection): Use delete for copy
constructor.
* callbacks.hh (class callbacks): Use delete for copy constructor.
Diffstat (limited to 'libcc1/callbacks.hh')
-rw-r--r-- | libcc1/callbacks.hh | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libcc1/callbacks.hh b/libcc1/callbacks.hh index b1f3e98..dc470c6 100644 --- a/libcc1/callbacks.hh +++ b/libcc1/callbacks.hh @@ -42,6 +42,9 @@ namespace cc1_plugin callbacks (); ~callbacks (); + callbacks (const callbacks &) = delete; + callbacks &operator= (const callbacks &) = delete; + // Add a callback named NAME. FUNC is the function to call when // this method is invoked. void add_callback (const char *name, callback_ftype *func); @@ -52,10 +55,6 @@ namespace cc1_plugin private: - // Declared but not defined to avoid use. - callbacks (const callbacks &); - callbacks &operator= (const callbacks &); - // The mapping. htab_t m_registry; }; |