diff --git a/include/llvm/Support/FormatAdapters.h b/include/llvm/Support/FormatAdapters.h index b5fd9459e16..3ad69475468 100644 --- a/include/llvm/Support/FormatAdapters.h +++ b/include/llvm/Support/FormatAdapters.h @@ -33,10 +33,10 @@ template class AlignAdapter : public AdapterBase { public: AlignAdapter(T &&Item, AlignStyle Where, size_t Amount) - : AdapterBase(std::forward(Item)), Where(Where), Amount(Amount) {} + : AdapterBase(std::forward(Item)), Where(Where), Amount(Amount) {} void format(llvm::raw_ostream &Stream, StringRef Style) { - auto Wrapper = detail::build_format_wrapper(std::forward(Item)); + auto Wrapper = detail::build_format_wrapper(std::forward(this->Item)); FmtAlign(Wrapper, Where, Amount).format(Stream, Style); } }; @@ -47,10 +47,10 @@ template class PadAdapter : public AdapterBase { public: PadAdapter(T &&Item, size_t Left, size_t Right) - : AdapterBase(std::forward(Item)), Left(Left), Right(Right) {} + : AdapterBase(std::forward(Item)), Left(Left), Right(Right) {} void format(llvm::raw_ostream &Stream, StringRef Style) { - auto Wrapper = detail::build_format_wrapper(std::forward(Item)); + auto Wrapper = detail::build_format_wrapper(std::forward(this->Item)); Stream.indent(Left); Wrapper.format(Stream, Style); Stream.indent(Right); @@ -62,10 +62,10 @@ template class RepeatAdapter : public AdapterBase { public: RepeatAdapter(T &&Item, size_t Count) - : AdapterBase(std::forward(Item)), Count(Count) {} + : AdapterBase(std::forward(Item)), Count(Count) {} void format(llvm::raw_ostream &Stream, StringRef Style) { - auto Wrapper = detail::build_format_wrapper(std::forward(Item)); + auto Wrapper = detail::build_format_wrapper(std::forward(this->Item)); for (size_t I = 0; I < Count; ++I) { Wrapper.format(Stream, Style); } diff --git a/include/llvm/Support/FormatProviders.h b/include/llvm/Support/FormatProviders.h index a7c774428f5..be0e5bab10c 100644 --- a/include/llvm/Support/FormatProviders.h +++ b/include/llvm/Support/FormatProviders.h @@ -68,7 +68,7 @@ protected: Result = None; } else { assert(Prec < 100 && "Precision out of range"); - Result = std::min(99u, Prec); + Result = std::min(99u, Prec); } return Result; } diff --git a/include/llvm/Support/FormatVariadicDetails.h b/include/llvm/Support/FormatVariadicDetails.h index 5d8b0b69bbf..daae5432b26 100644 --- a/include/llvm/Support/FormatVariadicDetails.h +++ b/include/llvm/Support/FormatVariadicDetails.h @@ -50,13 +50,7 @@ public: } }; -template class missing_format_wrapper : public format_wrapper { -public: - missing_format_wrapper() { - static_assert(false, "T does not have a format_provider"); - } - void format(llvm::raw_ostream &S, StringRef Options) override {} -}; +template class missing_format_wrapper; // Test if T is a class that contains a member function with the signature: //