diff options
author | Pavel Labath <pavel@labath.sk> | 2019-08-14 13:59:04 +0000 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2019-08-14 13:59:04 +0000 |
commit | 0d802a4923e6a603aa1ee06d0969a793cc93f858 (patch) | |
tree | fde71a9121ecb420aef7eb9c858b3101056a836e /llvm/unittests/Support/FileOutputBufferTest.cpp | |
parent | 571c52af58d91662f2a7f2c7570bab63dee71a53 (diff) | |
download | bcm5719-llvm-0d802a4923e6a603aa1ee06d0969a793cc93f858.tar.gz bcm5719-llvm-0d802a4923e6a603aa1ee06d0969a793cc93f858.zip |
Revert "raw_ostream: add operator<< overload for std::error_code"
This reverts commit r368849, because it breaks some bots (e.g.
llvm-clang-x86_64-win-fast).
It turns out this is not as NFC as we had hoped, because operator== will
consider two std::error_codes to be distinct even though they both hold
"success" values if they have different categories.
llvm-svn: 368854
Diffstat (limited to 'llvm/unittests/Support/FileOutputBufferTest.cpp')
-rw-r--r-- | llvm/unittests/Support/FileOutputBufferTest.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/unittests/Support/FileOutputBufferTest.cpp b/llvm/unittests/Support/FileOutputBufferTest.cpp index 24b6b0d4b2a..8afc2125ef4 100644 --- a/llvm/unittests/Support/FileOutputBufferTest.cpp +++ b/llvm/unittests/Support/FileOutputBufferTest.cpp @@ -18,7 +18,16 @@ using namespace llvm; using namespace llvm::sys; -#define ASSERT_NO_ERROR(x) ASSERT_EQ(x, std::error_code()) +#define ASSERT_NO_ERROR(x) \ + if (std::error_code ASSERT_NO_ERROR_ec = x) { \ + SmallString<128> MessageStorage; \ + raw_svector_ostream Message(MessageStorage); \ + Message << #x ": did not return errc::success.\n" \ + << "error number: " << ASSERT_NO_ERROR_ec.value() << "\n" \ + << "error message: " << ASSERT_NO_ERROR_ec.message() << "\n"; \ + GTEST_FATAL_FAILURE_(MessageStorage.c_str()); \ + } else { \ + } namespace { TEST(FileOutputBuffer, Test) { |