X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=unittests%2FSupport%2FTrailingObjectsTest.cpp;h=4c05d665f98b5af15759070a3801393d7b5c05e2;hp=2b8ab4c5fb83a763bce56ffbfc6e12566c4ef328;hb=9fc3869acde3a67528cd87f5ead02b5b8eccbd0a;hpb=ca5c277bdf14f18f69ef36ef43f350e95a20f69b diff --git a/unittests/Support/TrailingObjectsTest.cpp b/unittests/Support/TrailingObjectsTest.cpp index 2b8ab4c5fb8..4c05d665f98 100644 --- a/unittests/Support/TrailingObjectsTest.cpp +++ b/unittests/Support/TrailingObjectsTest.cpp @@ -164,7 +164,8 @@ TEST(TrailingObjects, ThreeArg) { sizeof(double) + sizeof(short) + 3 * sizeof(bool)); EXPECT_EQ(sizeof(Class3), llvm::RoundUpToAlignment(1, llvm::alignOf())); - Class3 *C = reinterpret_cast(::operator new(1000)); + std::unique_ptr P(new char[1000]); + Class3 *C = reinterpret_cast(P.get()); EXPECT_EQ(C->getTrailingObjects(), reinterpret_cast(C + 1)); EXPECT_EQ(C->getTrailingObjects(), reinterpret_cast(reinterpret_cast(C + 1) + 1));