From fb2f0a5e01f59b708fdffd614c659e2e035d9da0 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 2 Aug 2012 18:39:48 +0000 Subject: [PATCH] Andrew Morrow: There are two tests under test/utilities/memory that heap allocate two integers which remain unused and are subsequently leaked, so the test fail when run under valgrind. Unless I'm overlooking a subtle reason why they are needed I think they can be removed, allowing these tests to pass under valgrind. The attached patch removes the variables. If there is a reason for them to exist, I can change this to just delete them at the end of the test. llvm-svn: 161195 --- .../memory/unique.ptr/unique.ptr.special/cmp_nullptr.pass.cpp | 2 -- .../util.smartptr.shared.cmp/cmp_nullptr.pass.cpp | 2 -- 2 files changed, 4 deletions(-) diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/cmp_nullptr.pass.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/cmp_nullptr.pass.cpp index deb615ecb1d5..22ae217a61d6 100644 --- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/cmp_nullptr.pass.cpp +++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.special/cmp_nullptr.pass.cpp @@ -43,8 +43,6 @@ void do_nothing(int*) {} int main() { - int* ptr1(new int); - int* ptr2(new int); const std::unique_ptr p1(new int(1)); assert(!(p1 == nullptr)); assert(!(nullptr == p1)); diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/cmp_nullptr.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/cmp_nullptr.pass.cpp index d8d3113fc30d..f40cbc3d0324 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/cmp_nullptr.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/cmp_nullptr.pass.cpp @@ -43,8 +43,6 @@ void do_nothing(int*) {} int main() { - int* ptr1(new int); - int* ptr2(new int); const std::shared_ptr p1(new int(1)); assert(!(p1 == nullptr)); assert(!(nullptr == p1));