From 9a6c6f6b50f71d8c4dfc1211947c8f16637b6df5 Mon Sep 17 00:00:00 2001 From: Marcin Ropa Date: Sat, 8 Oct 2022 22:16:46 +0200 Subject: [PATCH] fix: static analysis problems (#785) --- include/CLI/FormatterFwd.hpp | 4 ++++ include/CLI/Validators.hpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/CLI/FormatterFwd.hpp b/include/CLI/FormatterFwd.hpp index 792ebbc..bdae54d 100644 --- a/include/CLI/FormatterFwd.hpp +++ b/include/CLI/FormatterFwd.hpp @@ -57,6 +57,8 @@ class FormatterBase { FormatterBase() = default; FormatterBase(const FormatterBase &) = default; FormatterBase(FormatterBase &&) = default; + FormatterBase &operator=(const FormatterBase &) = default; + FormatterBase &operator=(FormatterBase &&) = default; /// Adding a destructor in this form to work around bug in GCC 4.7 virtual ~FormatterBase() noexcept {} // NOLINT(modernize-use-equals-default) @@ -118,6 +120,8 @@ class Formatter : public FormatterBase { Formatter() = default; Formatter(const Formatter &) = default; Formatter(Formatter &&) = default; + Formatter &operator=(const Formatter &) = default; + Formatter &operator=(Formatter &&) = default; /// @name Overridables ///@{ diff --git a/include/CLI/Validators.hpp b/include/CLI/Validators.hpp index 9a6a364..8b0c5c1 100644 --- a/include/CLI/Validators.hpp +++ b/include/CLI/Validators.hpp @@ -750,7 +750,7 @@ class AsNumberWithUnit : public Validator { // transform function func_ = [mapping, opts](std::string &input) -> std::string { - Number num; + Number num{}; detail::rtrim(input); if(input.empty()) { -- libgit2 0.21.4