diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-09 19:47:39 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-09 19:47:39 +0000 |
commit | e279c777f7ab973fd0394633b69c5e04c7b39f45 (patch) | |
tree | 2ce8b1eb29c5edb2a4fe62bb5d821b12710856d7 /unittests | |
parent | d92ff21d6f526cadea7d6db21f493ba5c85e1411 (diff) | |
download | llvm-e279c777f7ab973fd0394633b69c5e04c7b39f45.tar.gz llvm-e279c777f7ab973fd0394633b69c5e04c7b39f45.tar.bz2 llvm-e279c777f7ab973fd0394633b69c5e04c7b39f45.tar.xz |
Add a unit test for the copy constructor.
I would not normally add tests like these, but the copy constructor is not
used at all in our codebase with c++11, so having this tests might prevent
breaking the c++03 build again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198886 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Support/ErrorOrTest.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/unittests/Support/ErrorOrTest.cpp b/unittests/Support/ErrorOrTest.cpp index 98174e8cd7..8a5b068d47 100644 --- a/unittests/Support/ErrorOrTest.cpp +++ b/unittests/Support/ErrorOrTest.cpp @@ -23,6 +23,9 @@ TEST(ErrorOr, SimpleValue) { EXPECT_TRUE(a); EXPECT_EQ(1, *a); + ErrorOr<int> b = a; + EXPECT_EQ(1, *b); + a = t2(); EXPECT_FALSE(a); EXPECT_EQ(errc::invalid_argument, a.getError()); |