Commit 9a6c6f6b50f71d8c4dfc1211947c8f16637b6df5
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>
Showing
2 changed files
with
5 additions
and
1 deletions
include/CLI/FormatterFwd.hpp
| @@ -57,6 +57,8 @@ class FormatterBase { | @@ -57,6 +57,8 @@ class FormatterBase { | ||
| 57 | FormatterBase() = default; | 57 | FormatterBase() = default; |
| 58 | FormatterBase(const FormatterBase &) = default; | 58 | FormatterBase(const FormatterBase &) = default; |
| 59 | FormatterBase(FormatterBase &&) = default; | 59 | FormatterBase(FormatterBase &&) = default; |
| 60 | + FormatterBase &operator=(const FormatterBase &) = default; | ||
| 61 | + FormatterBase &operator=(FormatterBase &&) = default; | ||
| 60 | 62 | ||
| 61 | /// Adding a destructor in this form to work around bug in GCC 4.7 | 63 | /// Adding a destructor in this form to work around bug in GCC 4.7 |
| 62 | virtual ~FormatterBase() noexcept {} // NOLINT(modernize-use-equals-default) | 64 | virtual ~FormatterBase() noexcept {} // NOLINT(modernize-use-equals-default) |
| @@ -118,6 +120,8 @@ class Formatter : public FormatterBase { | @@ -118,6 +120,8 @@ class Formatter : public FormatterBase { | ||
| 118 | Formatter() = default; | 120 | Formatter() = default; |
| 119 | Formatter(const Formatter &) = default; | 121 | Formatter(const Formatter &) = default; |
| 120 | Formatter(Formatter &&) = default; | 122 | Formatter(Formatter &&) = default; |
| 123 | + Formatter &operator=(const Formatter &) = default; | ||
| 124 | + Formatter &operator=(Formatter &&) = default; | ||
| 121 | 125 | ||
| 122 | /// @name Overridables | 126 | /// @name Overridables |
| 123 | ///@{ | 127 | ///@{ |
include/CLI/Validators.hpp
| @@ -750,7 +750,7 @@ class AsNumberWithUnit : public Validator { | @@ -750,7 +750,7 @@ class AsNumberWithUnit : public Validator { | ||
| 750 | 750 | ||
| 751 | // transform function | 751 | // transform function |
| 752 | func_ = [mapping, opts](std::string &input) -> std::string { | 752 | func_ = [mapping, opts](std::string &input) -> std::string { |
| 753 | - Number num; | 753 | + Number num{}; |
| 754 | 754 | ||
| 755 | detail::rtrim(input); | 755 | detail::rtrim(input); |
| 756 | if(input.empty()) { | 756 | if(input.empty()) { |