[libcxx] r269665 - Add a test for uniqueptr having either NULL and nullptr
Marshall Clow via cfe-commits
cfe-commits at lists.llvm.org
Mon May 16 09:57:15 PDT 2016
Author: marshall
Date: Mon May 16 11:57:15 2016
New Revision: 269665
URL: http://llvm.org/viewvc/llvm-project?rev=269665&view=rev
Log:
Add a test for uniqueptr having either NULL and nullptr
Modified:
libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp
Modified: libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp?rev=269665&r1=269664&r2=269665&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp Mon May 16 11:57:15 2016
@@ -40,4 +40,10 @@ int main()
assert(s.get_deleter().state() == 0);
}
assert(A::count == 0);
+
+ { // LWG#2520 says that nullptr is a valid input as well as null
+ std::unique_ptr<A[], Deleter<A[]> > s1(NULL, Deleter<A[]>());
+ std::unique_ptr<A[], Deleter<A[]> > s2(nullptr, Deleter<A[]>());
+ }
+ assert(A::count == 0);
}
More information about the cfe-commits
mailing list