This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/78052] New: [5/6/7 Regression] allocator_traits<allocator<T>> partial specialization vs allocator<void>
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 20 Oct 2016 09:29:10 +0000
- Subject: [Bug libstdc++/78052] New: [5/6/7 Regression] allocator_traits<allocator<T>> partial specialization vs allocator<void>
- Auto-submitted: auto-generated
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.