[v3] add max_size and rebind to __alloc_traits
Daniel Krügler
daniel.kruegler@googlemail.com
Thu Oct 6 12:56:00 GMT 2011
2011/10/6 Paolo Carlini <paolo.carlini@oracle.com>:
> Hi,
>>
>> I think you're right it wasn't failing before, as I ran the whole
>> testsuite in C++0x mode when I first added alloc_traits - I'll check it
>> today and see how I broke it.
>
> Thanks. In the meanwhile I checked r179522 and in fact yesterday I was
> wrong, it already failed (we had quite a bit of noise in the testsuite run
> in C++0x mode, I'm in the process of dealing with the most obvious issues,
> like pod_char_traits.h).
>
> Now it remains to be assessed whether it's Ok for it to fail ;)
I haven't run the test (so I don't know the particular failure), but looking at
the test code it looks broken for C++11 and implementation-defined for
C++03. The reason why it is broken in C++11 is:
1) allocator_traits<__gnu_test::uneq_allocator>::type>::propagate_on_container_swap
is false_type (or I missed to find a specialization that corrects
this), this means
vector::swap shall not swap it.
2) a.get_allocator() != b.get_allocator() is not satisfied within
vector::swap, therefore
the behaviour is undefined.
This is a view from a "up on the mountain", so there could be a lot of
details I missed.
One necessary fix seems to add a specialization
allocator_traits<__gnu_test::uneq_allocator>::type>
with the correct value for propagate_on_container_swap.
- Daniel
More information about the Libstdc++
mailing list