aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/ErrorOrTest.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2015-05-21 23:15:00 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2015-05-21 23:15:00 +0000
commitabc3984149ed4393620179a0770e56d6247539ee (patch)
tree9937fa7d4f89b63e8c26713059167b15c0c741f6 /llvm/unittests/Support/ErrorOrTest.cpp
parent1f835e3ae7000c8db0e364859758bca97fc7c65f (diff)
downloadllvm-abc3984149ed4393620179a0770e56d6247539ee.zip
llvm-abc3984149ed4393620179a0770e56d6247539ee.tar.gz
llvm-abc3984149ed4393620179a0770e56d6247539ee.tar.bz2
[Support] Fix ErrorOr equality operator.
llvm-svn: 237970
Diffstat (limited to 'llvm/unittests/Support/ErrorOrTest.cpp')
-rw-r--r--llvm/unittests/Support/ErrorOrTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/unittests/Support/ErrorOrTest.cpp b/llvm/unittests/Support/ErrorOrTest.cpp
index 82bbe09..5e8d442 100644
--- a/llvm/unittests/Support/ErrorOrTest.cpp
+++ b/llvm/unittests/Support/ErrorOrTest.cpp
@@ -66,6 +66,11 @@ TEST(ErrorOr, Covariant) {
ErrorOr<std::unique_ptr<int>> b4(b3);
}
+TEST(ErrorOr, Comparison) {
+ ErrorOr<int> x(std::errc::no_such_file_or_directory);
+ EXPECT_EQ(x, std::errc::no_such_file_or_directory);
+}
+
// ErrorOr<int*> x(nullptr);
// ErrorOr<std::unique_ptr<int>> y = x; // invalid conversion
static_assert(