https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44677
--- Comment #22 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Unfinished testcase, with -Wunused-but-set-variable=1 this warns just about i in foo, with -Wunused-but-set-variable=2 about a, b, c, d, i and with -Wunused-but-set-variable=3 about a, b, c, d, e, i. No warnings in bar in any case.