diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2019-01-24 19:20:19 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2019-01-24 19:20:19 +0000 |
| commit | 5a8525e0b6d2fb18e54db6f484597c81c7a067d7 (patch) | |
| tree | 0d0e5c1389d170bf64bb2b4cdc886eb91af1ec9d /libcxx/include/algorithm | |
| parent | 03f9e25bb0a91cf1b3bea0c62a93aab7518ccde7 (diff) | |
| download | bcm5719-llvm-5a8525e0b6d2fb18e54db6f484597c81c7a067d7.tar.gz bcm5719-llvm-5a8525e0b6d2fb18e54db6f484597c81c7a067d7.zip | |
D14686: 'Protect against overloaded comma in random_shuffle and improve tests' I had to cut back on the tests with this, because they were not C++03 friendly. Thanks to gribozavr for the patch
llvm-svn: 352087
Diffstat (limited to 'libcxx/include/algorithm')
| -rw-r--r-- | libcxx/include/algorithm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm index 310256e614f..b52d445225b 100644 --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -2989,7 +2989,7 @@ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last) { _Dp __uid; __rs_default __g = __rs_get(); - for (--__last, --__d; __first < __last; ++__first, --__d) + for (--__last, (void) --__d; __first < __last; ++__first, (void) --__d) { difference_type __i = __uid(__g, _Pp(0, __d)); if (__i != difference_type(0)) @@ -3011,7 +3011,7 @@ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, difference_type __d = __last - __first; if (__d > 1) { - for (--__last; __first < __last; ++__first, --__d) + for (--__last; __first < __last; ++__first, (void) --__d) { difference_type __i = __rand(__d); if (__i != difference_type(0)) |

