From c7cf23e4bf45918a045c7df5c8511a17e86556ad Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Sat, 18 Feb 2012 20:12:03 +0000 Subject: Exercise rvalue arguements to make_shared for C++11 mode. llvm-svn: 150887 --- .../util.smartptr.shared.create/make_shared.pass.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libcxx/test/utilities/memory') diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp index 0dc242ac9fd..eda148cf6ca 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp @@ -62,5 +62,16 @@ int main() assert(p->get_int() == 67); assert(p->get_char() == 'e'); } +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + nc = new_count; + { + char c = 'e'; + std::shared_ptr p = std::make_shared(67, c); + assert(new_count == nc+1); + assert(A::count == 1); + assert(p->get_int() == 67); + assert(p->get_char() == 'e'); + } +#endif assert(A::count == 0); } -- cgit v1.2.3