From fd6177ffd65b782ca8f554ad067c0a80088a3650 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Fri, 26 May 2017 00:37:33 +0000 Subject: [PATCH] [test] make_shared(...) is, uh, libc++-specific git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303947 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../make_shared.pass.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp index 1f0bea13e..0fd086341 100644 --- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp +++ b/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 x(&theFunction, &resultDeletor); + std::shared_ptr y(theFunction, resultDeletor); + } + assert(resultDeletorCount == 2); +#endif +} + int main() { int nc = globalMemCounter.outstanding_new; @@ -72,11 +82,9 @@ int main() std::shared_ptr p2 = std::make_shared(); assert(p2.get()); } - { // https://bugs.llvm.org/show_bug.cgi?id=27566 - std::shared_ptr x(&theFunction, &resultDeletor); - std::shared_ptr y(theFunction, resultDeletor); - } - assert(resultDeletorCount == 2); + + test_pointer_to_function(); + #if TEST_STD_VER >= 11 nc = globalMemCounter.outstanding_new; {