Page MenuHomePhabricator

[libcxx] Portability fix: unordered_set and unordered_multiset iterators are not required to be the same.

Authored by amakc11 on Jan 9 2019, 7:35 AM.



The unordered_set and unordered_multiset iterators are specified in the standard as follows:

using iterator             = implementation-defined; // see [container.requirements]
using const_iterator       = implementation-defined; // see [container.requirements]
using local_iterator       = implementation-defined; // see [container.requirements]
using const_local_iterator = implementation-defined; // see [container.requirements]

The pairs iterator/const_iterator and local_iterator/const_local_iterator are not required to be the same. The reasonable requirement would be that iterator can convert to const_iterator and local_iterator can convert to const_local_iterator. This patch weakens the check and makes the test more portable.

Diff Detail

rCXX libc++

Event Timeline

amakc11 created this revision.Jan 9 2019, 7:35 AM
ldionne accepted this revision.Jan 24 2019, 9:07 AM
This revision is now accepted and ready to land.Jan 24 2019, 9:07 AM

Just to confirm, are you OK with this being committed under the new LLVM license? See for details.

Yes, I am. The same is true for all other my patches awaiting review.

ldionne closed this revision.Jan 24 2019, 11:09 AM

Thanks. Committed as r352083.