This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/78052] New: [5/6/7 Regression] allocator_traits<allocator<T>> partial specialization vs allocator<void>


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

            Bug ID: 78052
           Summary: [5/6/7 Regression] allocator_traits<allocator<T>>
                    partial specialization vs allocator<void>
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

This used to work, until I added a partial specialization for
allocator_traits<allocator<T>> which assumes that allocator<T>::construct and
allocator<T>::destroy exist:

#include <memory>

int main()
{
  int i;
  std::allocator<void> a;
  std::allocator_traits<std::allocator<void>>::construct(a, &i, 0);
  std::allocator_traits<std::allocator<void>>::destroy(a, &i);
}

std::allocator<void> isn't really a valid, because void is not an object type,
but it is a "proto-allocator" according to the Networking TS, and the
construct/destroy functions don't dependon the value_type anyway so there's no
reason this code shouldn't work.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]