[Bug libstdc++/87982] No error for std::generate_n(ptr, ptr, f)

2019-04-29 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87982 --- Comment #11 from Jonathan Wakely --- Addressed in r270651

[Bug libstdc++/87982] No error for std::generate_n(ptr, ptr, f)

2019-04-29 Thread j.v.dijk at tue dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87982 --- Comment #10 from Jan van Dijk --- Thanks a lot. And sorry for being pedantic, but I believe that the documentation of the return value of generate_n is still wrong for negative __n (see the first part of comment #5).

[Bug libstdc++/87982] No error for std::generate_n(ptr, ptr, f)

2019-04-29 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87982 Jonathan Wakely changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug libstdc++/87982] No error for std::generate_n(ptr, ptr, f)

2019-04-29 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87982 --- Comment #8 from Jonathan Wakely --- Author: redi Date: Mon Apr 29 12:12:43 2019 New Revision: 270646 URL: https://gcc.gnu.org/viewcvs?rev=270646=gcc=rev Log: PR libstdc++/87982 Fix generate_n and fill_n use of _Size parameter The standard

[Bug libstdc++/87982] No error for std::generate_n(ptr, ptr, f)

2019-04-29 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87982 --- Comment #7 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #4) > I think converting it to the iterator's difference type is the right fix. > Doing that would make the original example ill-formed, because the pointer >

[Bug libstdc++/87982] No error for std::generate_n(ptr, ptr, f)

2019-04-28 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87982 --- Comment #6 from Jonathan Wakely --- (In reply to Jan van Dijk from comment #5) > Somewhat off-topic: IMHO the standard is not explicit about the fact that > gen() is (of course) to be invoked separately for every element in the range: > "The

[Bug libstdc++/87982] No error for std::generate_n(ptr, ptr, f)

2019-04-28 Thread j.v.dijk at tue dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87982 --- Comment #5 from Jan van Dijk --- Thanks a lot for this change. One more nit: the standard clause 28.6.7(2) allows (== does not forbid) negative count arguments, in which case generate_n is a no-op returning __first, but this is not

[Bug libstdc++/87982] No error for std::generate_n(ptr, ptr, f)

2019-04-28 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87982 Jonathan Wakely changed: What|Removed |Added Status|NEW |ASSIGNED

[Bug libstdc++/87982] No error for std::generate_n(ptr, ptr, f)

2019-04-28 Thread j.v.dijk at tue dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87982 Jan van Dijk changed: What|Removed |Added CC||j.v.dijk at tue dot nl --- Comment #3

[Bug libstdc++/87982] No error for std::generate_n(ptr, ptr, f)

2018-11-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87982 --- Comment #2 from Jonathan Wakely --- std::fill_n has the same problem (in both overloads of __fill_n_a).

[Bug libstdc++/87982] No error for std::generate_n(ptr, ptr, f)

2018-11-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87982 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|