[cfe-commits] r160330 - in /cfe/trunk: lib/Analysis/UninitializedValues.cpp test/Sema/uninit-variables.c test/SemaCXX/uninit-variables.cpp

Jordan Rose jordan_rose at apple.com
Mon Jul 16 17:15:33 PDT 2012


On Jul 16, 2012, at 17:06 , Richard Smith <richard-llvm at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120716/99c57b63/attachment.html>


More information about the cfe-commits mailing list