summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/memory
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-05-10 20:09:20 +0000
committerEric Fiselier <eric@efcs.ca>2017-05-10 20:09:20 +0000
commitf3a74e7d28714fc1a33b5164180bcc8ecf6efead (patch)
tree00dfbbf8dfa497f13711fb2f87e861a220e404ed /libcxx/test/std/utilities/memory
parent7300119abb55ac7251182b2859acadcebee304f0 (diff)
downloadbcm5719-llvm-f3a74e7d28714fc1a33b5164180bcc8ecf6efead.tar.gz
bcm5719-llvm-f3a74e7d28714fc1a33b5164180bcc8ecf6efead.zip
Fix enable_shared_from_this test in C++11
llvm-svn: 302721
Diffstat (limited to 'libcxx/test/std/utilities/memory')
-rw-r--r--libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
index 5124e025253..eb0d0a955fc 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
+++ b/libcxx/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<PrivateBase> {
- std::weak_ptr<PrivateBase> 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<PrivateBase> APtr;
- typedef std::weak_ptr<PrivateBase> WeakAPtr;
- APtr a1 = std::make_shared<PrivateBase>();
- assert(a1.use_count() == 1);
- }
+ {
+ typedef std::shared_ptr<PrivateBase> APtr;
+ typedef std::weak_ptr<PrivateBase> WeakAPtr;
+ APtr a1 = std::make_shared<PrivateBase>();
+ 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:
OpenPOWER on IntegriCloud