[libcxx] r303947 - [test] make_shared<T()>(...) is, uh, libc++-specific
Casey Carter via cfe-commits
cfe-commits at lists.llvm.org
Thu May 25 17:37:34 PDT 2017
Author: caseycarter
Date: Thu May 25 19:37:33 2017
New Revision: 303947
URL: http://llvm.org/viewvc/llvm-project?rev=303947&view=rev
Log:
[test] make_shared<T()>(...) is, uh, libc++-specific
Modified:
libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp
Modified: libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp?rev=303947&r1=303946&r2=303947&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp Thu May 25 19:37:33 2017
@@ -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;
{
More information about the cfe-commits
mailing list