diff --git a/clang-tools-extra/clang-tidy/ClangTidyCheck.h b/clang-tools-extra/clang-tidy/ClangTidyCheck.h --- a/clang-tools-extra/clang-tidy/ClangTidyCheck.h +++ b/clang-tools-extra/clang-tidy/ClangTidyCheck.h @@ -350,12 +350,21 @@ /// Stores an option with the check-local name \p LocalName with /// integer value \p Value to \p Options. template - std::enable_if_t::value> + std::enable_if_t::value && std::is_signed::value> store(ClangTidyOptions::OptionMap &Options, StringRef LocalName, T Value) const { storeInt(Options, LocalName, Value); } + /// Stores an option with the check-local name \p LocalName with + /// unsigned integer value \p Value to \p Options. + template + std::enable_if_t::value> + store(ClangTidyOptions::OptionMap &Options, StringRef LocalName, + T Value) const { + storeUnsigned(Options, LocalName, Value); + } + /// Stores an option with the check-local name \p LocalName as the string /// representation of the Enum \p Value to \p Options. /// @@ -398,7 +407,8 @@ void storeInt(ClangTidyOptions::OptionMap &Options, StringRef LocalName, int64_t Value) const; - + void storeUnsigned(ClangTidyOptions::OptionMap &Options, + StringRef LocalName, uint64_t Value) const; std::string NamePrefix; const ClangTidyOptions::OptionMap &CheckOptions; diff --git a/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp b/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp --- a/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp @@ -138,6 +138,12 @@ store(Options, LocalName, llvm::itostr(Value)); } +void ClangTidyCheck::OptionsView::storeUnsigned( + ClangTidyOptions::OptionMap &Options, StringRef LocalName, + uint64_t Value) const { + store(Options, LocalName, llvm::utostr(Value)); +} + template <> void ClangTidyCheck::OptionsView::store( ClangTidyOptions::OptionMap &Options, StringRef LocalName,