https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96742
--- Comment #8 from CVS Commits ---
The master branch has been updated by Marek Polacek :
https://gcc.gnu.org/g:976e7ef1a2d54f46021f74d071d9fdb9631298f8
commit r11-4501-g976e7ef1a2d54f46021f74d071d9fdb9631298f8
Author: Marek Polacek
Date:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96742
Hana Dusíková changed:
What|Removed |Added
CC||hanicka at hanicka dot net
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96742
Marek Polacek changed:
What|Removed |Added
CC||erenon2 at gmail dot com
--- Comment #6
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96742
--- Comment #5 from Jonathan Wakely ---
Oh and since C++17 you can do:
if constexpr (N != 0)
for (size_t i = 0; i < N; ++i) {
ret += i * x[i];
}
but it still shouldn't be necessary :-)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96742
--- Comment #4 from Jonathan Wakely ---
(In reply to William Throwe from comment #2)
> This warns if passed an array of length 0 because the for-loop condition is
> always false. Any change I can make to fix it seems to make the code worse.
> I
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96742
Richard Biener changed:
What|Removed |Added
Priority|P3 |P2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96742
Marek Polacek changed:
What|Removed |Added
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed|