[Support][ErrorOr] Add support for convertable types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174357 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael J. Spencer
2013-02-05 08:22:27 +00:00
parent ea59f896a6
commit a33e1fafac
2 changed files with 16 additions and 3 deletions

View File

@@ -53,6 +53,17 @@ TEST(ErrorOr, Types) {
EXPECT_EQ(3, **t3());
#endif
}
struct B {};
struct D : B {};
TEST(ErrorOr, Covariant) {
ErrorOr<B*> b(ErrorOr<D*>(0));
#if LLVM_HAS_CXX11_STDLIB
ErrorOr<std::unique_ptr<B> > b1(ErrorOr<std::unique_ptr<D> >(0));
#endif
}
} // end anon namespace
struct InvalidArgError {