diff mbox series

Mark the copy/move constructor/operator= of auto_bitmap as delete

Message ID 20240914072301.59833-1-quic_apinski@quicinc.com
State New
Headers show
Series Mark the copy/move constructor/operator= of auto_bitmap as delete | expand

Commit Message

Andrew Pinski Sept. 14, 2024, 7:23 a.m. UTC
Since we are written in C++11, these should be marked as delete rather
than just private.

Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

	* bitmap.h (class auto_bitmap): Mark copy/move constructor/operator=
	as deleted.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
---
 gcc/bitmap.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Richard Biener Sept. 15, 2024, 5:26 a.m. UTC | #1
On Sat, Sep 14, 2024 at 9:24 AM Andrew Pinski <quic_apinski@quicinc.com> wrote:
>
> Since we are written in C++11, these should be marked as delete rather
> than just private.

OK

> Bootstrapped and tested on x86_64-linux-gnu.
>
> gcc/ChangeLog:
>
>         * bitmap.h (class auto_bitmap): Mark copy/move constructor/operator=
>         as deleted.
>
> Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
> ---
>  gcc/bitmap.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/gcc/bitmap.h b/gcc/bitmap.h
> index 4cad1b4d6c6..451edcfc590 100644
> --- a/gcc/bitmap.h
> +++ b/gcc/bitmap.h
> @@ -959,10 +959,10 @@ class auto_bitmap
>
>   private:
>    // Prevent making a copy that references our bitmap.
> -  auto_bitmap (const auto_bitmap &);
> -  auto_bitmap &operator = (const auto_bitmap &);
> -  auto_bitmap (auto_bitmap &&);
> -  auto_bitmap &operator = (auto_bitmap &&);
> +  auto_bitmap (const auto_bitmap &) = delete;
> +  auto_bitmap &operator = (const auto_bitmap &) = delete;
> +  auto_bitmap (auto_bitmap &&) = delete;
> +  auto_bitmap &operator = (auto_bitmap &&) = delete;
>
>    bitmap_head m_bits;
>  };
> --
> 2.43.0
>
diff mbox series

Patch

diff --git a/gcc/bitmap.h b/gcc/bitmap.h
index 4cad1b4d6c6..451edcfc590 100644
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -959,10 +959,10 @@  class auto_bitmap
 
  private:
   // Prevent making a copy that references our bitmap.
-  auto_bitmap (const auto_bitmap &);
-  auto_bitmap &operator = (const auto_bitmap &);
-  auto_bitmap (auto_bitmap &&);
-  auto_bitmap &operator = (auto_bitmap &&);
+  auto_bitmap (const auto_bitmap &) = delete;
+  auto_bitmap &operator = (const auto_bitmap &) = delete;
+  auto_bitmap (auto_bitmap &&) = delete;
+  auto_bitmap &operator = (auto_bitmap &&) = delete;
 
   bitmap_head m_bits;
 };