summaryrefslogtreecommitdiffstats
path: root/libcxx/include/deque
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2014-10-27 19:28:20 +0000
committerEric Fiselier <eric@efcs.ca>2014-10-27 19:28:20 +0000
commit910285b238910084aabe786178337b158b82a3bb (patch)
tree983346d157ad4ff829f679c4d3f7639e47fd24d8 /libcxx/include/deque
parentf2896281784aa7a2e279559dc935a3250d85c2ca (diff)
downloadbcm5719-llvm-910285b238910084aabe786178337b158b82a3bb.tar.gz
bcm5719-llvm-910285b238910084aabe786178337b158b82a3bb.zip
[libcxx] Fix use of operator comma where the types can be user defined
Summary: An evil user might overload operator comma. Use a void cast to make sure any user overload is not selected. Modify all the test iterators to define operator comma. Reviewers: danalbert, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5929 llvm-svn: 220706
Diffstat (limited to 'libcxx/include/deque')
-rw-r--r--libcxx/include/deque6
1 files changed, 3 insertions, 3 deletions
diff --git a/libcxx/include/deque b/libcxx/include/deque
index 9b256b74d4f..5602d4a3fdc 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -1588,7 +1588,7 @@ deque<_Tp, _Allocator>::assign(_InputIter __f, _InputIter __l,
{
iterator __i = __base::begin();
iterator __e = __base::end();
- for (; __f != __l && __i != __e; ++__f, ++__i)
+ for (; __f != __l && __i != __e; ++__f, (void) ++__i)
*__i = *__f;
if (__f != __l)
__append(__f, __l);
@@ -2160,7 +2160,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
if (__n > __de)
{
__m = __de < __n / 2 ? _VSTD::next(__f, __de) : _VSTD::prev(__l, __n - __de);
- for (_BiIter __j = __m; __j != __l; ++__i, ++__j, ++__base::size())
+ for (_BiIter __j = __m; __j != __l; ++__i, (void) ++__j, ++__base::size())
__alloc_traits::construct(__a, _VSTD::addressof(*__i), *__j);
__n = __de;
}
@@ -2200,7 +2200,7 @@ deque<_Tp, _Allocator>::__append(_ForIter __f, _ForIter __l,
if (__n > __back_capacity)
__add_back_capacity(__n - __back_capacity);
// __n <= __back_capacity
- for (iterator __i = __base::end(); __f != __l; ++__i, ++__f, ++__base::size())
+ for (iterator __i = __base::end(); __f != __l; ++__i, (void) ++__f, ++__base::size())
__alloc_traits::construct(__a, _VSTD::addressof(*__i), *__f);
}
OpenPOWER on IntegriCloud