https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128685

            Bug ID: 128685
           Summary: Cleanup omp::allocator::user_mem in omp.h
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

Some cleanup and more tests for user_mem would surely help.

In particular, as
https://gcc.sashiko.dev/#/patchset/d9755d33-a8d9-4026-b561-3371e42939cd%40baylibre.com
noted:

* "In omp::allocator::user_mem::user_mem in libgomp/omp.h.in, […] omitting the
converting constructor required by the C++ Allocator requirements for
rebind_alloc:
  template <typename __U>
  user_mem (const user_mem<__U> &__u) __GOMP_NOTHROW
    : __my_alloc (__u.__my_alloc) {}
[…]
Without this converting constructor, a rejects-valid compilation failure
occurs whenever omp::allocator::user_mem<T> is used with any standard C++
container or utility that rebinds its allocator to an internal node or
storage type (such as std::list, std::deque, std::map, std::set,
std::unordered_map, std::vector<bool>, or std::allocate_shared)."

* Additional suggestion on the naming of the member variable.

* And: "neither operator== nor operator!= is defined for user_mem"

Reply via email to