Exercise rvalue arguements to make_shared for C++11 mode.

llvm-svn: 150887
This commit is contained in:
Howard Hinnant 2012-02-18 20:12:03 +00:00
parent 082d482981
commit c7cf23e4bf
1 changed files with 11 additions and 0 deletions

View File

@ -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);
}