https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122062

--- Comment #2 from 康桓瑋 <hewillk at gmail dot com> ---
(In reply to Jonathan Wakely from comment #1)
> --- a/libstdc++-v3/include/bits/random.tcc
> +++ b/libstdc++-v3/include/bits/random.tcc
> @@ -83,7 +83,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>        __normalize(_InputIterator __first, _InputIterator __last,
>                   _OutputIterator __result, const _Tp& __factor)
>        {
> -       for (; __first != __last; ++__first, ++__result)
> +       for (; __first != __last; ++__first, (void) ++__result)
>           *__result = *__first / __factor;
>         return __result;
>        }
> @@ -3197,7 +3197,7 @@ namespace __detail
>                  _InputIteratorW __wbegin)
>        : _M_int(), _M_den(), _M_cp(), _M_m()
>        {
> -       for (; __bbegin != __bend; ++__bbegin, ++__wbegin)
> +       for (; __bbegin != __bend; ++__bbegin, (void) ++__wbegin)
>           {
>             _M_int.push_back(*__bbegin);
>             _M_den.push_back(*__wbegin);

__normalize doesn't seem to be needed, since it only takes vector::iterator.

Reply via email to