From: Nick Terrell Date: Wed, 1 Dec 2021 02:26:11 +0000 (-0800) Subject: [contrib][pzstd] Fix build issue with gcc-5 X-Git-Tag: v1.5.1~1^2~47^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2889%2Fhead;p=thirdparty%2Fzstd.git [contrib][pzstd] Fix build issue with gcc-5 gcc-5 didn't like the l-value overload for defaulted operator=. There is no reason it needs to be l-value overloaded, so just remove it. I'm not sure why the build broke for @mckaygerhard in Issue #2811, since this code hasn't changed since it was added. But, there is no harm in fixing it. Fixes issue #2811. --- diff --git a/contrib/pzstd/utils/Buffer.h b/contrib/pzstd/utils/Buffer.h index f69c3b4d9..d17ad2f2c 100644 --- a/contrib/pzstd/utils/Buffer.h +++ b/contrib/pzstd/utils/Buffer.h @@ -45,7 +45,7 @@ class Buffer { : buffer_(buffer), range_(data) {} Buffer(Buffer&&) = default; - Buffer& operator=(Buffer&&) & = default; + Buffer& operator=(Buffer&&) = default; /** * Splits the data into two pieces: [begin, begin + n), [begin + n, end). diff --git a/contrib/pzstd/utils/Range.h b/contrib/pzstd/utils/Range.h index fedb5d786..6a850ad4e 100644 --- a/contrib/pzstd/utils/Range.h +++ b/contrib/pzstd/utils/Range.h @@ -6,7 +6,7 @@ * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). */ - + /** * A subset of `folly/Range.h`. * All code copied verbatim modulo formatting @@ -83,8 +83,8 @@ class Range { Range(const Range&) = default; Range(Range&&) = default; - Range& operator=(const Range&) & = default; - Range& operator=(Range&&) & = default; + Range& operator=(const Range&) = default; + Range& operator=(Range&&) = default; constexpr size_type size() const { return e_ - b_;