From: Kostya Serebryany Date: Mon, 21 Dec 2015 19:09:01 +0000 (+0000) Subject: fix leak in a test, make the sanitizer bot green X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=9fc3869acde3a67528cd87f5ead02b5b8eccbd0a;hp=15368636686ba54560244bb08ece60f1c4ad2ab0 fix leak in a test, make the sanitizer bot green git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256179 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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));