From 74424d09b4db468f806ea8d49a1c98d7f2f49eef Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Wed, 10 May 2017 20:09:20 +0000 Subject: [PATCH] Fix enable_shared_from_this test in C++11 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302721 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../enable_shared_from_this.pass.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp index 5124e0252..eb0d0a955 100644 --- a/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp +++ b/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp @@ -50,7 +50,6 @@ struct Bar : public Foo { struct PrivateBase : private std::enable_shared_from_this { - std::weak_ptr get_weak() { return weak_from_this(); } }; @@ -79,12 +78,12 @@ int main() assert(p == q); assert(!p.owner_before(q) && !q.owner_before(p)); // p and q share ownership } - { - typedef std::shared_ptr APtr; - typedef std::weak_ptr WeakAPtr; - APtr a1 = std::make_shared(); - assert(a1.use_count() == 1); - } + { + typedef std::shared_ptr APtr; + typedef std::weak_ptr WeakAPtr; + APtr a1 = std::make_shared(); + assert(a1.use_count() == 1); + } // Test LWG issue 2529. Only reset '__weak_ptr_' when it's already expired. // http://cplusplus.github.io/LWG/lwg-active.html#2529. // Test two different ways: