From cd56deb6bf6ce6fa192b3ef255fa2cc1e538ed7e Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 9 Jan 2014 19:47:39 +0000 Subject: 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. llvm-svn: 198886 --- llvm/unittests/Support/ErrorOrTest.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/unittests') diff --git a/llvm/unittests/Support/ErrorOrTest.cpp b/llvm/unittests/Support/ErrorOrTest.cpp index 98174e8cd70..8a5b068d479 100644 --- a/llvm/unittests/Support/ErrorOrTest.cpp +++ b/llvm/unittests/Support/ErrorOrTest.cpp @@ -23,6 +23,9 @@ TEST(ErrorOr, SimpleValue) { EXPECT_TRUE(a); EXPECT_EQ(1, *a); + ErrorOr b = a; + EXPECT_EQ(1, *b); + a = t2(); EXPECT_FALSE(a); EXPECT_EQ(errc::invalid_argument, a.getError()); -- cgit v1.2.3