On Jul 16, 2012, at 17:06 , Richard Smith <richard-l...@metafoo.co.uk> wrote:
> int test6() {
> int x; // expected-note{{initialize the variable 'x' to silence this
> warning}}
> - x += 2; // expected-warning{{variable 'x' is uninitialized when used here}}
> - return x;
> + x += 2;
> + return x; // expected-warning{{variable 'x' is uninitialized when used
> here}}
> }
Sorry for not chiming in pre-commit, but I'm not happy with this. The first
non-compound-assignment use of a variable could be very far from the variable,
and while we do get a note on the decl, it still seems like a QoI problem. I'd
rather have compound assignments treated as a use and an initialization.
(Actually, can we just call it a use? Does that hurt anything?)
Sorry to complain about a good cleanup, but…
Jordan
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits