[Bug c++/107466] [12/13 Regression] invalid -Wnarrowing error with std::subtract_with_carry_engine

2022-10-31 Thread littlefox+gcc-bugzilla--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107466 --- Comment #3 from Mara Sophie Grosch --- Standard explicitly allows using unsigned short though: https://en.cppreference.com/w/cpp/numeric/random/subtract_with_carry_engine

[Bug c++/107466] [12/13 Regression] invalid -Wnarrowing error with std::subtract_with_carry_engine

2022-10-30 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107466 --- Comment #2 from Jonathan Wakely --- I don't think this is a compiler bug. Converting that value to uint16_t is narrowing. The problem is that the standard requires subtract_with_carry_engine to use linear_congruential_engine where each of t

[Bug c++/107466] [12/13 Regression] invalid -Wnarrowing error with std::subtract_with_carry_engine

2022-10-30 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107466 --- Comment #1 from Andrew Pinski --- Shorter testcase (still includes): #include void f() { std::subtract_with_carry_engine(); }