On Wed, Dec 16, 2015 at 10:04:05AM -0500, David Malcolm wrote:
> On Wed, 2015-12-16 at 15:58 +0100, Marek Polacek wrote:
> > The following improves the location for "statement with no effect" warning
> > by
> > using the location of the expression if available. Can't use EXPR_LOCATION
> > as
> > *_DECLs still don't carry a location.
>
> Out of interest, does it emit sane underlined ranges for these cases,
> with the patch?
Yes, it emits what I'd expect, e.g.:
pr64637.c:10:28: warning: statement with no effect [-Wunused-value]
for (int i = 0; i < b; i + b)
~~^~~
Similarly for the rest.
(Yes, I could've used dg-begin-multiline-output + dg-end-multiline-output to
check that, but I think what I have right now in the test should be enough.)
Marek