Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions llvm/include/llvm/Support/Error.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstdint>
Expand Down Expand Up @@ -1262,15 +1261,6 @@ inline Error createStringError(std::errc EC, char const *Fmt,
return createStringError(std::make_error_code(EC), Fmt, Vals...);
}

template <typename... Ts>
inline Error createStringErrorV(std::error_code EC, const char *Fmt,
const Ts &...Vals) {
std::string Buffer;
raw_string_ostream Stream(Buffer);
Stream << formatv(Fmt, Vals...);
return make_error<StringError>(Stream.str(), EC);
}

/// This class wraps a filename and another Error.
///
/// In some cases, an error needs to live along a 'source' name, in order to
Expand Down
17 changes: 0 additions & 17 deletions llvm/unittests/Support/ErrorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,23 +472,6 @@ TEST(Error, createStringError) {
<< "Failed to convert createStringError() result to error_code.";
}

TEST(Error, createStringErrorV) {
static llvm::StringRef Bar("bar");
static const std::error_code EC = errc::invalid_argument;
std::string Msg;
raw_string_ostream S(Msg);
logAllUnhandledErrors(createStringErrorV(EC, "foo{0}{1}{2:x}", Bar, 1, 0xff),
S);
EXPECT_EQ(S.str(), "foobar10xff\n")
<< "Unexpected createStringErrorV() log result";

S.flush();
Msg.clear();
auto Res = errorToErrorCode(createStringErrorV(EC, "foo{0}", Bar));
EXPECT_EQ(Res, EC)
<< "Failed to convert createStringErrorV() result to error_code.";
}

// Test that the ExitOnError utility works as expected.
TEST(ErrorDeathTest, ExitOnError) {
ExitOnError ExitOnErr;
Expand Down