================
@@ -56,19 +56,41 @@ class Status {
///
/// \param[in] type
/// The type for \a err.
- explicit Status(ValueType err,
- lldb::ErrorType type = lldb::eErrorTypeGeneric);
+ explicit Status(ValueType err, lldb::ErrorType type =
lldb::eErrorTypeGeneric,
+ llvm::StringRef msg = {});
Status(std::error_code EC);
- explicit Status(const char *format, ...)
- __attribute__((format(printf, 2, 3)));
+ /// Create a generic error with the message err_str.
+ explicit Status(std::string &&err_str);
+ /// Create a generic error with the message err_str.
+ explicit Status(llvm::StringRef err_str);
+
+ static Status FromErrorString(const char *format) {
+ if (format)
+ return Status(std::string(format));
+ return Status(std::string("null error"));
----------------
adrian-prantl wrote:
Note that Status stores a `std::string` internally and there's a
`Status(std::string&&)` constructor at work here.
https://github.com/llvm/llvm-project/pull/106163
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits