[test] make_shared<T()>(...) is, uh, libc++-specific

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303947 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Casey Carter
2017-05-26 00:37:33 +00:00
parent b3559ed0d6
commit fd6177ffd6

View File

@@ -53,6 +53,16 @@ static void resultDeletor(Result (*pf)()) {
++resultDeletorCount;
}
void test_pointer_to_function() {
#ifdef _LIBCPP_VER
{ // https://bugs.llvm.org/show_bug.cgi?id=27566
std::shared_ptr<Result()> x(&theFunction, &resultDeletor);
std::shared_ptr<Result()> y(theFunction, resultDeletor);
}
assert(resultDeletorCount == 2);
#endif
}
int main()
{
int nc = globalMemCounter.outstanding_new;
@@ -72,11 +82,9 @@ int main()
std::shared_ptr<const Foo> p2 = std::make_shared<const Foo>();
assert(p2.get());
}
{ // https://bugs.llvm.org/show_bug.cgi?id=27566
std::shared_ptr<Result()> x(&theFunction, &resultDeletor);
std::shared_ptr<Result()> y(theFunction, resultDeletor);
}
assert(resultDeletorCount == 2);
test_pointer_to_function();
#if TEST_STD_VER >= 11
nc = globalMemCounter.outstanding_new;
{