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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228496 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer
2015-02-07 16:41:02 +00:00
parent 3281412d2a
commit ff53b757ea
2 changed files with 53 additions and 45 deletions

View File

@@ -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