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

Christoph Conrads <g...@christoph-conrads.name> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |g...@christoph-conrads.name

--- Comment #1 from Christoph Conrads <g...@christoph-conrads.name> ---
Created attachment 44801
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44801&action=edit
C++11 code demonstrating GCC bug 80977

This file contains
* code demonstrating GCC bug 80977 and
* a modified version of std::uniform_int_distribution without bug 80977 when
operator() is invoked.

The modified implementation can be used by replacing
`std::uniform_int_distribution` with `standard:uniform_int_distribution` in
main().

The code triggers two warnings in lines 178 and 208 with `-Woverflow`. Line 178
belongs to modified code and overflow there is handled in lines 180-184. The
warning in line 208 is caused by unmodified libstdc++ code but judging by the
comment "wraparound control" in line 205, this is handled properly.

Reply via email to