diff options
Diffstat (limited to 'include/lldb/Core/Error.h')
-rw-r--r-- | include/lldb/Core/Error.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/lldb/Core/Error.h b/include/lldb/Core/Error.h index f33464816a16..8131580991ad 100644 --- a/include/lldb/Core/Error.h +++ b/include/lldb/Core/Error.h @@ -12,6 +12,7 @@ #if defined(__cplusplus) #include "llvm/Support/DataTypes.h" +#include "llvm/Support/FormatVariadic.h" #include <cstdarg> #include <cstdio> @@ -300,5 +301,15 @@ protected: } // namespace lldb_private +namespace llvm { +template <> struct format_provider<lldb_private::Error> { + static void format(const lldb_private::Error &error, llvm::raw_ostream &OS, + llvm::StringRef Options) { + llvm::format_provider<llvm::StringRef>::format(error.AsCString(), OS, + Options); + } +}; +} + #endif // #if defined(__cplusplus) #endif // #ifndef __DCError_h__ |