[Bug libstdc++/77994] std::sample uses incorrect integer types internally

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77994

--- Comment #4 from Jonathan Wakely  ---
Author: redi
Date: Mon Oct 17 17:03:09 2016
New Revision: 241263

URL: https://gcc.gnu.org/viewcvs?rev=241263=gcc=rev
Log:
Backport fixes to std::experimental::sample

PR libstdc++/77994
* include/experimental/algorithm (experimental::sample): Convert size
argument to iterator difference type. Fix invalid use of input
iterator. Defend against overloaded comma operator.

Modified:
branches/gcc-5-branch/libstdc++-v3/ChangeLog
branches/gcc-5-branch/libstdc++-v3/include/experimental/algorithm
   
branches/gcc-5-branch/libstdc++-v3/testsuite/experimental/algorithm/sample.cc

[Bug libstdc++/77994] std::sample uses incorrect integer types internally

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77994

--- Comment #3 from Jonathan Wakely  ---
Author: redi
Date: Mon Oct 17 16:50:37 2016
New Revision: 241249

URL: https://gcc.gnu.org/viewcvs?rev=241249=gcc=rev
Log:
Backport fixes to std::experimental::sample

PR libstdc++/77994
* include/experimental/algorithm (experimental::sample): Convert size
argument to iterator difference type. Fix invalid use of input
iterator. Defend against overloaded comma operator.

Modified:
branches/gcc-6-branch/libstdc++-v3/ChangeLog
branches/gcc-6-branch/libstdc++-v3/include/experimental/algorithm
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/algorithm/sample.cc

[Bug libstdc++/77994] std::sample uses incorrect integer types internally

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77994

Jonathan Wakely  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |7.0

--- Comment #2 from Jonathan Wakely  ---
Fixed, thanks for reporting the problem.

I'm also fixing std::experimental::sample for GCC 5.5 and 6.3

[Bug libstdc++/77994] std::sample uses incorrect integer types internally

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77994

--- Comment #1 from Jonathan Wakely  ---
Author: redi
Date: Mon Oct 17 14:39:23 2016
New Revision: 241245

URL: https://gcc.gnu.org/viewcvs?rev=241245=gcc=rev
Log:
PR77994 Convert std::sample size argument to suitable type

PR libstdc++/77994
* include/bits/stl_algo.h (sample): Convert size argument to iterator
difference type.
* include/experimental/algorithm (experimental::sample): Likewise.
* testsuite/25_algorithms/sample/2.cc: New test.

Added:
trunk/libstdc++-v3/testsuite/25_algorithms/sample/2.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/bits/stl_algo.h
trunk/libstdc++-v3/include/experimental/algorithm

[Bug libstdc++/77994] std::sample uses incorrect integer types internally

2016-10-15 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77994

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-10-15
 Ever confirmed|0   |1