Commit 9a6c6f6b50f71d8c4dfc1211947c8f16637b6df5

Authored by Marcin Ropa
Committed by GitHub
1 parent a66ae414

fix: static analysis problems (#785)

* fix: static analysis problems

* fix to warrnings reported by Klocwork in CLI11 v2.2.0

* style: pre-commit.ci fixes

* Update include/CLI/FormatterFwd.hpp

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>

* Update include/CLI/FormatterFwd.hpp

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
include/CLI/FormatterFwd.hpp
... ... @@ -57,6 +57,8 @@ class FormatterBase {
57 57 FormatterBase() = default;
58 58 FormatterBase(const FormatterBase &) = default;
59 59 FormatterBase(FormatterBase &&) = default;
  60 + FormatterBase &operator=(const FormatterBase &) = default;
  61 + FormatterBase &operator=(FormatterBase &&) = default;
60 62  
61 63 /// Adding a destructor in this form to work around bug in GCC 4.7
62 64 virtual ~FormatterBase() noexcept {} // NOLINT(modernize-use-equals-default)
... ... @@ -118,6 +120,8 @@ class Formatter : public FormatterBase {
118 120 Formatter() = default;
119 121 Formatter(const Formatter &) = default;
120 122 Formatter(Formatter &&) = default;
  123 + Formatter &operator=(const Formatter &) = default;
  124 + Formatter &operator=(Formatter &&) = default;
121 125  
122 126 /// @name Overridables
123 127 ///@{
... ...
include/CLI/Validators.hpp
... ... @@ -750,7 +750,7 @@ class AsNumberWithUnit : public Validator {
750 750  
751 751 // transform function
752 752 func_ = [mapping, opts](std::string &input) -> std::string {
753   - Number num;
  753 + Number num{};
754 754  
755 755 detail::rtrim(input);
756 756 if(input.empty()) {
... ...