Add a test for LWG issue #2399. We already implement this, but now we have a test...
authorMarshall Clow <mclow.lists@gmail.com>
Tue, 18 Nov 2014 18:14:53 +0000 (18:14 +0000)
committerMarshall Clow <mclow.lists@gmail.com>
Tue, 18 Nov 2014 18:14:53 +0000 (18:14 +0000)
llvm-svn: 222242

libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp

index d3b2859..dc2a6af 100644 (file)
@@ -55,6 +55,9 @@ struct A
 
 int A::count = 0;
 
+void fn ( const std::shared_ptr<int> &) {}
+void fn ( const std::shared_ptr<B> &) { assert (false); }
+
 int main()
 {
     {
@@ -91,4 +94,10 @@ int main()
     }
     }
     assert(A::count == 0);
+
+    // LWG 2399
+    {
+    throw_next = false;
+    fn(std::unique_ptr<int>(new int));
+    }
 }