[libcxx-commits] [PATCH] D66615: This patch resolves issue 2724.

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 22 12:24:51 PDT 2019


zoecarver created this revision.
zoecarver added reviewers: ldionne, mclow.lists, EricWF.
Herald added subscribers: libcxx-commits, dexonsmith, christof.
Herald added a project: libc++.

I did not mark it complete in the status because I have only updated the
expiremental library thus far.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66615

Files:
  libcxx/include/experimental/memory_resource
  libcxx/test/std/experimental/memory/memory.resource/memory.resource.priv/protected_members.fail.cpp


Index: libcxx/test/std/experimental/memory/memory.resource/memory.resource.priv/protected_members.fail.cpp
===================================================================
--- libcxx/test/std/experimental/memory/memory.resource/memory.resource.priv/protected_members.fail.cpp
+++ libcxx/test/std/experimental/memory/memory.resource/memory.resource.priv/protected_members.fail.cpp
@@ -10,9 +10,9 @@
 
 // <experimental/memory_resource>
 
-// memory_resource::do_allocate(size_t, size_t);          /* protected */
-// memory_resource::do_deallocate(void*, size_t, size_t); /* protected */
-// memory_resource::do_is_equal(memory_resource const&);  /* protected */
+// memory_resource::do_allocate(size_t, size_t);          /* private */
+// memory_resource::do_deallocate(void*, size_t, size_t); /* private */
+// memory_resource::do_is_equal(memory_resource const&);  /* private */
 
 #include <experimental/memory_resource>
 
@@ -20,9 +20,9 @@
 
 int main(int, char**) {
     ex::memory_resource *m = ex::new_delete_resource();
-    m->do_allocate(0, 0); // expected-error{{'do_allocate' is a protected member}}
-    m->do_deallocate(nullptr, 0, 0); // expected-error{{'do_deallocate' is a protected member}}
-    m->do_is_equal(*m); // expected-error{{'do_is_equal' is a protected member}}
+    m->do_allocate(0, 0); // expected-error{{'do_allocate' is a private member}}
+    m->do_deallocate(nullptr, 0, 0); // expected-error{{'do_deallocate' is a private member}}
+    m->do_is_equal(*m); // expected-error{{'do_is_equal' is a private member}}
 
   return 0;
 }
Index: libcxx/include/experimental/memory_resource
===================================================================
--- libcxx/include/experimental/memory_resource
+++ libcxx/include/experimental/memory_resource
@@ -116,7 +116,7 @@
         { return do_is_equal(__other); }
 
 // 8.5.3, memory.resource.priv
-protected:
+private:
     virtual void* do_allocate(size_t, size_t) = 0;
     virtual void do_deallocate(void*, size_t, size_t) = 0;
     virtual bool do_is_equal(memory_resource const &) const _NOEXCEPT = 0;
@@ -381,7 +381,7 @@
     { return __alloc_; }
 
 // 8.7.3, memory.resource.adaptor.mem
-protected:
+private:
     virtual void * do_allocate(size_t __bytes, size_t)
     {
         if (__bytes > __max_size()) {
@@ -407,7 +407,6 @@
         return __p  ? __alloc_ == __p->__alloc_ : false;
     }
 
-private:
     _LIBCPP_INLINE_VISIBILITY
     size_t __max_size() const _NOEXCEPT {
         return numeric_limits<size_t>::max() - _MaxAlign;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66615.216690.patch
Type: text/x-patch
Size: 2531 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190822/4e081090/attachment.bin>


More information about the libcxx-commits mailing list