summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities
diff options
context:
space:
mode:
authorErik Pilkington <erik.pilkington@gmail.com>2017-05-25 15:43:31 +0000
committerErik Pilkington <erik.pilkington@gmail.com>2017-05-25 15:43:31 +0000
commit72d0d603fbaefe23c10624b25ef9addacf9fd1f1 (patch)
tree6fe4920ae657ab31a88aae6590f9885ed48e4987 /libcxx/test/std/utilities
parent901c776d068aad3fbb4f2499b0c14ad3855412ca (diff)
downloadbcm5719-llvm-72d0d603fbaefe23c10624b25ef9addacf9fd1f1.tar.gz
bcm5719-llvm-72d0d603fbaefe23c10624b25ef9addacf9fd1f1.zip
Add support for shared_ptr<FunctionType>
Fixes PR27566. Differential revision: https://reviews.llvm.org/D30837 llvm-svn: 303874
Diffstat (limited to 'libcxx/test/std/utilities')
-rw-r--r--libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp13
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;
{
OpenPOWER on IntegriCloud