]> granicus.if.org Git - llvm/commitdiff
Try to fix build after llvm::formatv() patch.
authorZachary Turner <zturner@google.com>
Sat, 12 Nov 2016 00:18:42 +0000 (00:18 +0000)
committerZachary Turner <zturner@google.com>
Sat, 12 Nov 2016 00:18:42 +0000 (00:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286686 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/FormatAdapters.h
include/llvm/Support/FormatProviders.h
include/llvm/Support/FormatVariadicDetails.h

index b5fd9459e166694f7354fe5caa05d91de1812072..3ad69475468e9ea41eb112e3d366014b537710dd 100644 (file)
@@ -33,10 +33,10 @@ template <typename T> class AlignAdapter : public AdapterBase<T> {
 
 public:
   AlignAdapter(T &&Item, AlignStyle Where, size_t Amount)
-      : AdapterBase(std::forward<T>(Item)), Where(Where), Amount(Amount) {}
+      : AdapterBase<T>(std::forward<T>(Item)), Where(Where), Amount(Amount) {}
 
   void format(llvm::raw_ostream &Stream, StringRef Style) {
-    auto Wrapper = detail::build_format_wrapper(std::forward<T>(Item));
+    auto Wrapper = detail::build_format_wrapper(std::forward<T>(this->Item));
     FmtAlign(Wrapper, Where, Amount).format(Stream, Style);
   }
 };
@@ -47,10 +47,10 @@ template <typename T> class PadAdapter : public AdapterBase<T> {
 
 public:
   PadAdapter(T &&Item, size_t Left, size_t Right)
-      : AdapterBase(std::forward<T>(Item)), Left(Left), Right(Right) {}
+      : AdapterBase<T>(std::forward<T>(Item)), Left(Left), Right(Right) {}
 
   void format(llvm::raw_ostream &Stream, StringRef Style) {
-    auto Wrapper = detail::build_format_wrapper(std::forward<T>(Item));
+    auto Wrapper = detail::build_format_wrapper(std::forward<T>(this->Item));
     Stream.indent(Left);
     Wrapper.format(Stream, Style);
     Stream.indent(Right);
@@ -62,10 +62,10 @@ template <typename T> class RepeatAdapter : public AdapterBase<T> {
 
 public:
   RepeatAdapter(T &&Item, size_t Count)
-      : AdapterBase(std::forward<T>(Item)), Count(Count) {}
+      : AdapterBase<T>(std::forward<T>(Item)), Count(Count) {}
 
   void format(llvm::raw_ostream &Stream, StringRef Style) {
-    auto Wrapper = detail::build_format_wrapper(std::forward<T>(Item));
+    auto Wrapper = detail::build_format_wrapper(std::forward<T>(this->Item));
     for (size_t I = 0; I < Count; ++I) {
       Wrapper.format(Stream, Style);
     }
index a7c774428f5aad3ea330e05d45db9b99372b58fd..be0e5bab10c64e626fddd4229016e155e30dd7f2 100644 (file)
@@ -68,7 +68,7 @@ protected:
       Result = None;
     } else {
       assert(Prec < 100 && "Precision out of range");
-      Result = std::min(99u, Prec);
+      Result = std::min<size_t>(99u, Prec);
     }
     return Result;
   }
index 5d8b0b69bbf9a2beb84f0d1c37856c8ac6240bb4..daae5432b26fe5f99240edf1c89922d9998c70db 100644 (file)
@@ -50,13 +50,7 @@ public:
   }
 };
 
-template <typename T> 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 <typename T> class missing_format_wrapper;
 
 // Test if T is a class that contains a member function with the signature:
 //