diff --git a/.clang-tidy b/.clang-tidy index 5af2fd13..0fa0c2e8 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,6 +1,6 @@ #Checks: '*,-clang-analyzer-alpha.*' #Checks: '-*,google-readability-casting,llvm-namespace-comment,performance-unnecessary-value-param,llvm-include-order,misc-throw-by-value-catch-by-reference,readability-container-size-empty,google-runtime-references,modernize*' -Checks: '-*,llvm-namespace-comment,llvm-include-order,readability-container-size-empty,misc-throw-by-value-catch-by-reference,modernize*' +Checks: '-*,llvm-namespace-comment,llvm-include-order,readability-container-size-empty,misc-throw-by-value-catch-by-reference,modernize*,google-readability-casting' HeaderFilterRegex: '.*hpp' CheckOptions: - key: readability-braces-around-statements.ShortStatementLines diff --git a/include/CLI/App.hpp b/include/CLI/App.hpp index 1ad646ce..d6047f1a 100644 --- a/include/CLI/App.hpp +++ b/include/CLI/App.hpp @@ -307,7 +307,7 @@ public: count = 0; CLI::callback_t fun = [&count](CLI::results_t res){ - count = (T) res.size(); + count = static_cast(res.size()); return true; }; diff --git a/include/CLI/TypeTools.hpp b/include/CLI/TypeTools.hpp index b9afe37a..cf42be6c 100644 --- a/include/CLI/TypeTools.hpp +++ b/include/CLI/TypeTools.hpp @@ -102,7 +102,7 @@ namespace detail { template::value, detail::enabler> = detail::dummy> bool lexical_cast(std::string input, T& output) { try{ - output = (T) std::stoll(input); + output = static_cast(std::stoll(input)); return true; } catch (const std::invalid_argument&) { return false; @@ -115,7 +115,7 @@ namespace detail { template::value, detail::enabler> = detail::dummy> bool lexical_cast(std::string input, T& output) { try{ - output = (T) std::stold(input); + output =static_cast(std::stold(input)); return true; } catch (const std::invalid_argument&) { return false; diff --git a/include/CLI/Validators.hpp b/include/CLI/Validators.hpp index e1b16334..893b1c14 100644 --- a/include/CLI/Validators.hpp +++ b/include/CLI/Validators.hpp @@ -81,7 +81,7 @@ std::function Range(T min, T max) { /// Range of one value is 0 to value template std::function Range(T max) { - return Range((T) 0, max); + return Range(static_cast(0), max); } /// @}