http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57647
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> --- It should work for any type, but, why don't you do only foo++;, i.e. drop the cast? In that case there shouldn't be value computed is not used warning.