summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Dionne <ldionne@apple.com>2019-01-24 19:09:22 +0000
committerLouis Dionne <ldionne@apple.com>2019-01-24 19:09:22 +0000
commitc43f673090d86237d6eb832c4244fc121070486d (patch)
tree4334fcc0d34a9f5c90e7ec7e04a2f5c5ece775c2
parent18972d1ee960b6903aba3eaaef66f5d84a8010a2 (diff)
downloadbcm5719-llvm-c43f673090d86237d6eb832c4244fc121070486d.tar.gz
bcm5719-llvm-c43f673090d86237d6eb832c4244fc121070486d.zip
[libcxx] Portability fix: unordered_set and unordered_multiset iterators are not required to be the same
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. Reviewed as https://reviews.llvm.org/D56493. Thanks to Andrey Maksimov for the patch. llvm-svn: 352083
-rw-r--r--libcxx/test/std/containers/unord/iterator_difference_type.pass.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libcxx/test/std/containers/unord/iterator_difference_type.pass.cpp b/libcxx/test/std/containers/unord/iterator_difference_type.pass.cpp
index fe2a83a01ea..3f0b61e5f22 100644
--- a/libcxx/test/std/containers/unord/iterator_difference_type.pass.cpp
+++ b/libcxx/test/std/containers/unord/iterator_difference_type.pass.cpp
@@ -51,10 +51,10 @@ void testUnorderedMap() {
template <class Set, class ValueTp, class CPtrT>
void testUnorderedSet() {
- static_assert((std::is_same<typename Set::iterator,
- typename Set::const_iterator>::value), "");
- static_assert((std::is_same<typename Set::local_iterator,
- typename Set::const_local_iterator>::value), "");
+ static_assert((std::is_convertible<typename Set::iterator,
+ typename Set::const_iterator>::value), "");
+ static_assert((std::is_convertible<typename Set::local_iterator,
+ typename Set::const_local_iterator>::value), "");
typedef typename Set::difference_type Diff;
{
typedef typename Set::iterator It;
OpenPOWER on IntegriCloud