mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-01-05 23:23:53 +00:00
[Support][ErrorOr] Add support for implicit conversion from error code/condition enums.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176228 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -18,7 +18,7 @@ using namespace llvm;
|
||||
namespace {
|
||||
|
||||
ErrorOr<int> t1() {return 1;}
|
||||
ErrorOr<int> t2() {return make_error_code(errc::invalid_argument);}
|
||||
ErrorOr<int> t2() { return errc::invalid_argument; }
|
||||
|
||||
TEST(ErrorOr, SimpleValue) {
|
||||
ErrorOr<int> a = t1();
|
||||
@@ -45,8 +45,8 @@ TEST(ErrorOr, Types) {
|
||||
*a = 42;
|
||||
EXPECT_EQ(42, x);
|
||||
|
||||
EXPECT_FALSE(ErrorOr<void>(make_error_code(errc::broken_pipe)));
|
||||
EXPECT_TRUE(ErrorOr<void>(make_error_code(errc::success)));
|
||||
EXPECT_FALSE(ErrorOr<void>(errc::broken_pipe));
|
||||
EXPECT_TRUE(ErrorOr<void>(errc::success));
|
||||
|
||||
#if LLVM_HAS_CXX11_STDLIB
|
||||
// Move only types.
|
||||
|
||||
Reference in New Issue
Block a user