aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ADT/SmallVectorTest.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-02-07 16:41:02 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-02-07 16:41:02 +0000
commit1d563f40da16d8858a03da8f5d99989eb636c572 (patch)
treeb210528e281ae3349c4a6ccfb0368765d26202ef /llvm/unittests/ADT/SmallVectorTest.cpp
parent0238b96c065540a7ec4ed4fdf243135e34d4ad9a (diff)
downloadllvm-1d563f40da16d8858a03da8f5d99989eb636c572.zip
llvm-1d563f40da16d8858a03da8f5d99989eb636c572.tar.gz
llvm-1d563f40da16d8858a03da8f5d99989eb636c572.tar.bz2
SmallVector: Move emplace_back to SmallVectorImpl.
This resolves the strange effect that emplace_back is only available when the type contained in the vector is not trivially copyable. llvm-svn: 228496
Diffstat (limited to 'llvm/unittests/ADT/SmallVectorTest.cpp')
-rw-r--r--llvm/unittests/ADT/SmallVectorTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/SmallVectorTest.cpp b/llvm/unittests/ADT/SmallVectorTest.cpp
index f6e9bb9..170a30b 100644
--- a/llvm/unittests/ADT/SmallVectorTest.cpp
+++ b/llvm/unittests/ADT/SmallVectorTest.cpp
@@ -896,6 +896,14 @@ TEST(SmallVectorTest, EmplaceBack) {
EXPECT_TRUE(V.back().A2.State == EAS_RValue);
EXPECT_TRUE(V.back().A3.State == EAS_LValue);
}
+ {
+ SmallVector<int, 1> V;
+ V.emplace_back();
+ V.emplace_back(42);
+ EXPECT_EQ(2U, V.size());
+ EXPECT_EQ(0, V[0]);
+ EXPECT_EQ(42, V[1]);
+ }
}
} // end namespace