clang: Enable -Weverything, fix all warnings

This change fixes the following warnings:

```
    -Wc++98-compat-extra-semi
    -Wc++98-compat-local-type-template-args
    -Wc++98-compat-pedantic
    -Wc++98-compat
    -Wcomma
    -Wdeprecated-copy-dtor
    -Wexit-time-destructors
    -Wextra-semi-stmt
    -Wextra-semi
    -Wfloat-conversion
    -Wfloat-equal
    -Wformat-nonliteral
    -Wglobal-constructors
    -Winconsistent-missing-destructor-override
    -Wnon-virtual-dtor
    -Wold-style-cast
    -Wpadded
    -Wreturn-std-move-in-c++11
    -Wshadow-field-in-constructor
    -Wshadow-uncaptured-local
    -Wshift-sign-overflow
    -Wsign-conversion
    -Wundef
    -Wunreachable-code-return
    -Wused-but-marked-unused
    -Wweak-vtables
    -Wzero-as-null-pointer-constant
```
This commit is contained in:
Ben Clayton
2020-06-10 12:31:43 +01:00
parent bb3dbcd2c3
commit 9d3f5c8f1d
15 changed files with 76 additions and 755 deletions

View File

@@ -98,14 +98,13 @@ struct ResponseOrError {
};
template <typename T>
ResponseOrError<T>::ResponseOrError(const T& response) : response(response) {}
ResponseOrError<T>::ResponseOrError(const T& resp) : response(resp) {}
template <typename T>
ResponseOrError<T>::ResponseOrError(T&& response)
: response(std::move(response)) {}
ResponseOrError<T>::ResponseOrError(T&& resp) : response(std::move(resp)) {}
template <typename T>
ResponseOrError<T>::ResponseOrError(const Error& error) : error(error) {}
ResponseOrError<T>::ResponseOrError(const Error& err) : error(err) {}
template <typename T>
ResponseOrError<T>::ResponseOrError(Error&& error) : error(std::move(error)) {}
ResponseOrError<T>::ResponseOrError(Error&& err) : error(std::move(err)) {}
template <typename T>
ResponseOrError<T>::ResponseOrError(const ResponseOrError& other)
: response(other.response), error(other.error) {}
@@ -148,7 +147,7 @@ class Session {
using ArgTy = typename detail::ArgTy<F>::type;
public:
virtual ~Session() = default;
virtual ~Session();
// ErrorHandler is the type of callback function used for reporting protocol
// errors.