1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-06 07:03:52 +00:00

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>
This commit is contained in:
Marcin Ropa 2022-10-08 22:16:46 +02:00 committed by GitHub
parent a66ae41457
commit 9a6c6f6b50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -57,6 +57,8 @@ class FormatterBase {
FormatterBase() = default; FormatterBase() = default;
FormatterBase(const FormatterBase &) = default; FormatterBase(const FormatterBase &) = default;
FormatterBase(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 /// Adding a destructor in this form to work around bug in GCC 4.7
virtual ~FormatterBase() noexcept {} // NOLINT(modernize-use-equals-default) virtual ~FormatterBase() noexcept {} // NOLINT(modernize-use-equals-default)
@ -118,6 +120,8 @@ class Formatter : public FormatterBase {
Formatter() = default; Formatter() = default;
Formatter(const Formatter &) = default; Formatter(const Formatter &) = default;
Formatter(Formatter &&) = default; Formatter(Formatter &&) = default;
Formatter &operator=(const Formatter &) = default;
Formatter &operator=(Formatter &&) = default;
/// @name Overridables /// @name Overridables
///@{ ///@{

View File

@ -750,7 +750,7 @@ class AsNumberWithUnit : public Validator {
// transform function // transform function
func_ = [mapping, opts](std::string &input) -> std::string { func_ = [mapping, opts](std::string &input) -> std::string {
Number num; Number num{};
detail::rtrim(input); detail::rtrim(input);
if(input.empty()) { if(input.empty()) {