https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90284
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2019-04-30 CC| |dmalcolm at gcc dot gnu.org, | |marxin at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> --- Confirmed. It's only related to C++, because for C we get: gcc -Wunused-value pr90284.c pr90284.c: In function ‘incorrect_warning’: pr90284.c:3:22: warning: left-hand operand of comma expression has no effect [-Wunused-value] 3 | return (0 ? 0 : 0, 999); | ^ pr90284.c: In function ‘correct_warning’: pr90284.c:8:14: warning: left-hand operand of comma expression has no effect [-Wunused-value] 8 | return (0, 999); | ^ So a possible enhancement. For C++ there was improvement of the second test-case by David in r267272: pr90284.c:8:16: warning: left operand of comma operator has no effect [-Wunused-value] return (0, 999); ^~~ after: pr90284.c:8:13: warning: left operand of comma operator has no effect [-Wunused-value] 8 | return (0, 999); | ^ I'm leaving that to David, hopefully he can fix it.