From 7bfc4cd2c812a3197c09797796828459714f8849 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 25 Sep 2020 13:59:15 +0200 Subject: [PATCH] middle-end/97207 - implement move assign for auto_vec<> This implements the missing move assignment to make std::swap work on auto_vec<> 2020-09-25 Richard Biener PR middle-end/97207 * vec.h (auto_vec::operator=(auto_vec&&)): Implement. --- gcc/vec.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/vec.h b/gcc/vec.h index d73d865cff2..d8c7cdac073 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -1546,7 +1546,13 @@ public: this->m_vec = r.m_vec; r.m_vec = NULL; } - void operator= (auto_vec&&) = delete; + auto_vec& operator= (auto_vec&& r) + { + this->release (); + this->m_vec = r.m_vec; + r.m_vec = NULL; + return *this; + } }; -- 2.30.2