[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 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220706 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user