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 | 13 |
1 files changed, 12 insertions, 1 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 2a7ac9979d0..1f0bea13e63 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 @@ -45,6 +45,13 @@ struct Foo virtual ~Foo() = default; }; +struct Result {}; +static Result theFunction() { return Result(); } +static int resultDeletorCount; +static void resultDeletor(Result (*pf)()) { + assert(pf == theFunction); + ++resultDeletorCount; +} int main() { @@ -65,7 +72,11 @@ 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); #if TEST_STD_VER >= 11 nc = globalMemCounter.outstanding_new; { |

