diff options
author | Lang Hames <lhames@gmail.com> | 2016-03-17 20:35:00 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2016-03-17 20:35:00 +0000 |
commit | 01a3cf4d31f3e7fa5a8ab4b4b7622900acda5340 (patch) | |
tree | f5e5165d8485923aef83fb667148397ebd556cac /llvm/unittests/Support/ErrorTest.cpp | |
parent | b0c4eae07339dce7d0d6e7e697fba37b41cb28cf (diff) | |
download | bcm5719-llvm-01a3cf4d31f3e7fa5a8ab4b4b7622900acda5340.tar.gz bcm5719-llvm-01a3cf4d31f3e7fa5a8ab4b4b7622900acda5340.zip |
[Support] Make Error::isA<T>() works on success values.
llvm-svn: 263745
Diffstat (limited to 'llvm/unittests/Support/ErrorTest.cpp')
-rw-r--r-- | llvm/unittests/Support/ErrorTest.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/unittests/Support/ErrorTest.cpp b/llvm/unittests/Support/ErrorTest.cpp index ed3d1c1852c..d5af2cab967 100644 --- a/llvm/unittests/Support/ErrorTest.cpp +++ b/llvm/unittests/Support/ErrorTest.cpp @@ -149,14 +149,17 @@ TEST(Error, CheckCustomErrors) { { Error E = make_error<CustomError>(1); Error F = make_error<CustomSubError>(1, 2); + Error G = Error::success(); EXPECT_TRUE(E.isA<CustomError>()); EXPECT_FALSE(E.isA<CustomSubError>()); EXPECT_TRUE(F.isA<CustomError>()); EXPECT_TRUE(F.isA<CustomSubError>()); + EXPECT_FALSE(G.isA<CustomError>()); consumeError(std::move(E)); consumeError(std::move(F)); + consumeError(std::move(G)); } // Check that we can handle a custom error. |