[cfe-commits] [libcxx] r161195 - in /libcxx/trunk/test/utilities/memory: unique.ptr/unique.ptr.special/cmp_nullptr.pass.cpp util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/cmp_nullptr.pass.cpp

Howard Hinnant hhinnant at apple.com
Thu Aug 2 11:39:48 PDT 2012


Author: hhinnant
Date: Thu Aug  2 13:39:48 2012
New Revision: 161195

URL: http://llvm.org/viewvc/llvm-project?rev=161195&view=rev
Log:
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.

Modified:
    libcxx/trunk/test/utilities/memory/unique.ptr/unique.ptr.special/cmp_nullptr.pass.cpp
    libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/cmp_nullptr.pass.cpp

Modified: libcxx/trunk/test/utilities/memory/unique.ptr/unique.ptr.special/cmp_nullptr.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/memory/unique.ptr/unique.ptr.special/cmp_nullptr.pass.cpp?rev=161195&r1=161194&r2=161195&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/memory/unique.ptr/unique.ptr.special/cmp_nullptr.pass.cpp (original)
+++ libcxx/trunk/test/utilities/memory/unique.ptr/unique.ptr.special/cmp_nullptr.pass.cpp Thu Aug  2 13:39:48 2012
@@ -43,8 +43,6 @@
 
 int main()
 {
-    int* ptr1(new int);
-    int* ptr2(new int);
     const std::unique_ptr<int> p1(new int(1));
     assert(!(p1 == nullptr));
     assert(!(nullptr == p1));

Modified: libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/cmp_nullptr.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/cmp_nullptr.pass.cpp?rev=161195&r1=161194&r2=161195&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/cmp_nullptr.pass.cpp (original)
+++ libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.cmp/cmp_nullptr.pass.cpp Thu Aug  2 13:39:48 2012
@@ -43,8 +43,6 @@
 
 int main()
 {
-    int* ptr1(new int);
-    int* ptr2(new int);
     const std::shared_ptr<int> p1(new int(1));
     assert(!(p1 == nullptr));
     assert(!(nullptr == p1));





More information about the cfe-commits mailing list