From a33e1fafac7fedb1b080ef07ddf9ad6ddff3a830 Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Tue, 5 Feb 2013 08:22:27 +0000 Subject: [Support][ErrorOr] Add support for convertable types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174357 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Support/ErrorOrTest.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'unittests/Support') diff --git a/unittests/Support/ErrorOrTest.cpp b/unittests/Support/ErrorOrTest.cpp index a860886..6cef4fc 100644 --- a/unittests/Support/ErrorOrTest.cpp +++ b/unittests/Support/ErrorOrTest.cpp @@ -53,6 +53,17 @@ TEST(ErrorOr, Types) { EXPECT_EQ(3, **t3()); #endif } + +struct B {}; +struct D : B {}; + +TEST(ErrorOr, Covariant) { + ErrorOr b(ErrorOr(0)); + +#if LLVM_HAS_CXX11_STDLIB + ErrorOr > b1(ErrorOr >(0)); +#endif +} } // end anon namespace struct InvalidArgError { -- cgit v1.1