]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
vec.h: Fix GCC build with -std=gnu++20 [PR98059]
authorScott Snyder <sss@li-snyder.org>
Wed, 2 Dec 2020 14:42:56 +0000 (15:42 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 6 Jan 2021 09:38:36 +0000 (10:38 +0100)
Apparently vec.h doesn't build with -std=c++20/gnu++20, since the
DR2237 r11-532 change.
template <typename T>
class auto_delete_vec
{
private:
  auto_vec_delete<T> (const auto_delete_vec<T> &) = delete;
};
which vec.h uses is invalid C++20, one needs to use
  auto_vec_delete (const auto_delete_vec &) = delete;
instead which is valid all the way back to C++11 (and without = delete
to C++98).

2020-12-02  Scott Snyder  <sss@li-snyder.org>

PR plugins/98059
* vec.h (auto_delete_vec): Use
DISABLE_COPY_AND_ASSIGN(auto_delete_vec) instead of
DISABLE_COPY_AND_ASSIGN(auto_delete_vec<T>) to make it valid C++20
after DR2237.

(cherry picked from commit bad800c03d00a57fc21718c160459d9a1e8d747a)

gcc/vec.h

index 3ad99b8369047056509c5ad1d5ec4ee311d06b70..c7bca2234675ef9fb1200663cf87f669616842fc 100644 (file)
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -1580,7 +1580,7 @@ class auto_delete_vec : public auto_vec <T *>
   ~auto_delete_vec ();
 
 private:
-  DISABLE_COPY_AND_ASSIGN(auto_delete_vec<T>);
+  DISABLE_COPY_AND_ASSIGN(auto_delete_vec);
 };
 
 /* Conditionally allocate heap memory for VEC and its internal vector.  */