diff options
Diffstat (limited to 'libcxx/test/std/utilities/memory')
-rw-r--r-- | libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp index 1f0bea13e63..0fd086341e7 100644 --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp @@ -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; { |