[PATCH] D13332: [libcxx] Remove uses of std::unique_ptr<T[N]> from test to prevent warning.

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 1 00:51:04 PDT 2015


EricWF created this revision.
EricWF added a reviewer: mclow.lists.
EricWF added subscribers: cfe-commits, mclow.lists.

constructing a std::unique_ptr<T[N]> will always cause a warning because the deleter (`std::default_delete<T[N]>`) will call `delete ptr` instead of `delete [] ptr`. This is a bug in the standard, not libc++.

I don't see a reason why removing the test cases will decrease coverage because std::unique_ptr<T> and std::unique_ptr<T[N]> select the same primary template. However since @mclow.lists wrote this test I want him to approve this patch.

http://reviews.llvm.org/D13332

Files:
  test/std/utilities/tuple/tuple.general/tuple.smartptr.pass.cpp

Index: test/std/utilities/tuple/tuple.general/tuple.smartptr.pass.cpp
===================================================================
--- test/std/utilities/tuple/tuple.general/tuple.smartptr.pass.cpp
+++ test/std/utilities/tuple/tuple.general/tuple.smartptr.pass.cpp
@@ -21,18 +21,10 @@
     std::tuple<std::unique_ptr<char>> up;
     std::tuple<std::shared_ptr<char>> sp;
     std::tuple<std::weak_ptr  <char>> wp;
-//     std::tuple<std::auto_ptr  <char>> ap;
     }
     {
     std::tuple<std::unique_ptr<char[]>> up;
     std::tuple<std::shared_ptr<char[]>> sp;
     std::tuple<std::weak_ptr  <char[]>> wp;
-//     std::tuple<std::auto_ptr  <char[]>> ap;
     }
-    {
-    std::tuple<std::unique_ptr<char[5]>> up;
-    std::tuple<std::shared_ptr<char[5]>> sp;
-    std::tuple<std::weak_ptr  <char[5]>> wp;
-//     std::tuple<std::auto_ptr  <char[5]>> ap;
-    }
-}
\ No newline at end of file
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13332.36195.patch
Type: text/x-patch
Size: 906 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151001/5e489ef6/attachment.bin>


More information about the cfe-commits mailing list