diff options
author | Casey Carter <Casey@Carter.net> | 2017-05-26 00:37:33 +0000 |
---|---|---|
committer | Casey Carter <Casey@Carter.net> | 2017-05-26 00:37:33 +0000 |
commit | a60c9bced5d6a578321b121ac77bd5796f67b28d (patch) | |
tree | 1430ac92af608fdd7785283603b75d73b9d292ed /libcxx/test/std/utilities/memory | |
parent | f5cdd40f89dddb29b36c44c33695e358416e6b95 (diff) | |
download | bcm5719-llvm-a60c9bced5d6a578321b121ac77bd5796f67b28d.tar.gz bcm5719-llvm-a60c9bced5d6a578321b121ac77bd5796f67b28d.zip |
[test] make_shared<T()>(...) is, uh, libc++-specific
llvm-svn: 303947
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; { |