From: Amos Jeffries Date: Sat, 18 Mar 2017 04:25:24 +0000 (+1300) Subject: Add move semantics to remaining HTTP Parser heirarchy X-Git-Tag: M-staged-PR71~216 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20b1beabff8c038b86ce7b09e938d11c3d929c90;p=thirdparty%2Fsquid.git Add move semantics to remaining HTTP Parser heirarchy Destructor is requied because this hierarchy contains virtuals, which in turn means the compiler will not add move constructor by default. So we must add teh default ones in ourselves. Detected by Coverity Scan. Issues 1364733 and 1364736. --- diff --git a/src/http/one/Parser.h b/src/http/one/Parser.h index c467f471a0..6112b59d1c 100644 --- a/src/http/one/Parser.h +++ b/src/http/one/Parser.h @@ -41,6 +41,11 @@ class Parser : public RefCountable public: typedef SBuf::size_type size_type; + Parser() = default; + Parser(const Parser &) = default; + Parser &operator =(const Parser &) = default; + Parser(Parser &&) = default; + Parser &operator =(Parser &&) = default; virtual ~Parser() {} /// Set this parser back to a default state. diff --git a/src/http/one/ResponseParser.h b/src/http/one/ResponseParser.h index d1ef0897f9..46362a0c0d 100644 --- a/src/http/one/ResponseParser.h +++ b/src/http/one/ResponseParser.h @@ -29,6 +29,11 @@ namespace One { class ResponseParser : public Http1::Parser { public: + ResponseParser() = default; + ResponseParser(const ResponseParser &) = default; + ResponseParser &operator =(const ResponseParser &) = default; + ResponseParser(ResponseParser &&) = default; + ResponseParser &operator =(ResponseParser &&) = default; virtual ~ResponseParser() {} /* Http::One::Parser API */