View | Details | Raw Unified | Return to bug 46440
Collapse All | Expand All

(-)a/unittest/gunit/stl_alloc-t.cc (-1 / +19 lines)
Lines 57-62 template <typename T> Link Here
57
class Malloc_allocator_wrapper : public Malloc_allocator<T> {
57
class Malloc_allocator_wrapper : public Malloc_allocator<T> {
58
 public:
58
 public:
59
  Malloc_allocator_wrapper() : Malloc_allocator<T>(PSI_NOT_INSTRUMENTED) {}
59
  Malloc_allocator_wrapper() : Malloc_allocator<T>(PSI_NOT_INSTRUMENTED) {}
60
61
  template<class U>
62
  Malloc_allocator_wrapper(const Malloc_allocator_wrapper<U> &other [[maybe_unused]])
63
     : Malloc_allocator<T>(PSI_NOT_INSTRUMENTED) {}
64
  template <class U>
65
  struct rebind {
66
    typedef Malloc_allocator_wrapper<U> other;
67
  };
60
};
68
};
61
69
62
template <typename T>
70
template <typename T>
Lines 69-74 class Mem_root_allocator_wrapper : public Mem_root_allocator<T> { Link Here
69
    m_mem_root.set_error_handler(nullptr);
77
    m_mem_root.set_error_handler(nullptr);
70
  }
78
  }
71
79
80
  template <class U>
81
  Mem_root_allocator_wrapper(const Mem_root_allocator_wrapper<U> &other [[maybe_unused]])
82
      : Mem_root_allocator<T>(&m_mem_root) {
83
    m_mem_root.set_error_handler(nullptr);
84
  }
85
72
  /*
86
  /*
73
    Allocators before C++17 need to be copy-constructible, and libc++ enforces
87
    Allocators before C++17 need to be copy-constructible, and libc++ enforces
74
    this (libstdc++ is fine with them being move-only). As a hack, we implement
88
    this (libstdc++ is fine with them being move-only). As a hack, we implement
Lines 82-87 class Mem_root_allocator_wrapper : public Mem_root_allocator<T> { Link Here
82
      : Mem_root_allocator<T>(&m_mem_root) {
96
      : Mem_root_allocator<T>(&m_mem_root) {
83
    memcpy(&m_mem_root, &other.m_mem_root, sizeof(m_mem_root));
97
    memcpy(&m_mem_root, &other.m_mem_root, sizeof(m_mem_root));
84
  }
98
  }
99
100
  template <class U>
101
  struct rebind {
102
    typedef Mem_root_allocator_wrapper<U> other;
103
  };
85
};
104
};
86
105
87
/*
106
/*
88
- 

Return to bug 46440