[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:
@@ -70,7 +70,7 @@ int main()
|
||||
typedef input_iterator<const T*> I;
|
||||
c.assign(I(std::begin(t0)), I(std::end(t0)));
|
||||
int n = 0;
|
||||
for (C::const_iterator i = c.cbegin(); i != c.cend(); ++i, ++n)
|
||||
for (C::const_iterator i = c.cbegin(); i != c.cend(); ++i, (void) ++n)
|
||||
assert(*i == 10+n);
|
||||
assert(n == 4);
|
||||
}
|
||||
|
Reference in New Issue
Block a user