diff options
author | Howard Hinnant <hhinnant@apple.com> | 2012-02-18 20:12:03 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2012-02-18 20:12:03 +0000 |
commit | c7cf23e4bf45918a045c7df5c8511a17e86556ad (patch) | |
tree | 6892d683039d9cca7122a6ddfc6c32ef118d3f7e /libcxx/test/utilities/memory | |
parent | 082d4829819a32607fa4ff0862bd0c7cc3abb723 (diff) | |
download | bcm5719-llvm-c7cf23e4bf45918a045c7df5c8511a17e86556ad.tar.gz bcm5719-llvm-c7cf23e4bf45918a045c7df5c8511a17e86556ad.zip |
Exercise rvalue arguements to make_shared for C++11 mode.
llvm-svn: 150887
Diffstat (limited to 'libcxx/test/utilities/memory')
-rw-r--r-- | libcxx/test/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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<A> p = std::make_shared<A>(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); } |