summaryrefslogtreecommitdiffstats
path: root/libcxx/include/forward_list
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/forward_list
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/forward_list')
-rw-r--r--libcxx/include/forward_list4
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list
index f48f41bceab..651452f3fe8 100644
--- a/libcxx/include/forward_list
+++ b/libcxx/include/forward_list
@@ -991,7 +991,7 @@ forward_list<_Tp, _Alloc>::assign(_InputIterator __f, _InputIterator __l)
iterator __i = before_begin();
iterator __j = _VSTD::next(__i);
iterator __e = end();
- for (; __j != __e && __f != __l; ++__i, ++__j, ++__f)
+ for (; __j != __e && __f != __l; ++__i, (void) ++__j, ++__f)
*__j = *__f;
if (__j == __e)
insert_after(__i, __f, __l);
@@ -1201,7 +1201,7 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p,
try
{
#endif // _LIBCPP_NO_EXCEPTIONS
- for (++__f; __f != __l; ++__f, __last = __last->__next_)
+ for (++__f; __f != __l; ++__f, ((void)(__last = __last->__next_)))
{
__h.reset(__node_traits::allocate(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f);
OpenPOWER on IntegriCloud